Skip to content

Commit

Permalink
Adding Smart agent package in B&R extract/upload script (#2197)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2197

## Why
In the smart agent approach, most of the importance component is the Smart agent server to handle handshake and exchange status. Having this dummy smart agent service to pack into binary

more details: https://docs.google.com/document/d/1QhfD3Dh2BHHM1_aDOn5MW6D9bnwn8wOD__WFdAN8dWE/edit#

{F897896043}
## What
- Adding Smart agent package in B&R extract/upload script

Reviewed By: musebc, jrodal98

Differential Revision: D43925687

fbshipit-source-id: 57c62186f5c619ba626b96559ac00ac9389f5722
  • Loading branch information
joe1234wu authored and facebook-github-bot committed Mar 17, 2023
1 parent 9b24415 commit a6c0673
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
1 change: 1 addition & 0 deletions binaries_out_lists/smart_agent.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
smart_agent_server
12 changes: 10 additions & 2 deletions extract-docker-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ set -e
PROG_NAME=$0
usage() {
cat << EOF >&2
Usage: $PROG_NAME <emp_games|data_processing|pid> [-t TAG] [-d DOCKER_IMAGE_NAME]
Usage: $PROG_NAME <emp_games|data_processing|pid|validation|smart_agent> [-t TAG] [-d DOCKER_IMAGE_NAME]
package:
emp_games - extracts the binaries from fbpcs/emp-games docker image
data_processing - extracts the binaries from fbpcs/data-processing docker image
pid - extracts the binaries from private-id docker image
validation - extracts the binaries from the onedocker docker image
smart_agent - extracts the binaries from the onedocker docker image
-t TAG: uses the image with the given tag (default: latest)
-d DOCKER_IMAGE_NAME: defines the image name to extract from
EOF
exit 1
}

PACKAGES="emp_games data_processing pid validation"
PACKAGES="emp_games data_processing pid validation smart_agent"
PACKAGE=$1
if [[ ! " $PACKAGES " =~ $PACKAGE ]]; then
usage
Expand Down Expand Up @@ -52,6 +53,7 @@ if [ -z "$DOCKER_IMAGE_NAME" ]; then
data_processing) DOCKER_IMAGE_NAME="fbpcs/data-processing";;
pid) DOCKER_IMAGE_NAME="fbpcs/onedocker/test";;
validation) DOCKER_IMAGE_NAME="fbpcs/onedocker/test";;
smart_agent) DOCKER_IMAGE_NAME="fbpcs/onedocker/test";;
esac
fi
DOCKER_IMAGE_PATH="${DOCKER_IMAGE_NAME}:${TAG}"
Expand Down Expand Up @@ -102,3 +104,9 @@ docker create -ti --name temp_container "${DOCKER_IMAGE_PATH}"
docker cp temp_container:/usr/local/bin/pc_pre_validation_cli "$SCRIPT_DIR/binaries_out/."
docker rm -f temp_container
fi

if [ "$PACKAGE" = "smart_agent" ]; then
docker create -ti --name temp_container "${DOCKER_IMAGE_PATH}"
docker cp temp_container:/usr/local/bin/smart_agent_server "$SCRIPT_DIR/binaries_out/."
docker rm -f temp_container
fi
1 change: 1 addition & 0 deletions promote_scripts/promote_binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ binary_names=(
'data_processing/attribution_id_combiner'
'data_processing/private_id_dfca_id_combiner'
'validation/pc_pre_validation_cli'
'smart_agent/smart_agent_server'
)

s3_path="s3://one-docker-repository-prod"
Expand Down
11 changes: 9 additions & 2 deletions upload-binaries-to-s3-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ set -e
PROG_NAME=$0
usage() {
cat << EOF >&2
Usage: $PROG_NAME <emp_games|data_processing|pid|validation> <tag>
Usage: $PROG_NAME <emp_games|data_processing|pid|validation|smart_agent> <tag>
package:
emp_games - extracts the binaries from fbpcs/emp-games docker image
data_processing - extracts the binaries from fbpcs/data-processing docker image
pid - extracts the binaries from private-id docker image
validation - extracts the binaries from the onedocker docker image
smart_agent - extracts the binaries from the onedocker docker image
tag: used to determine the subfolder/version in s3 for each binary
EOF
exit 1
}

PACKAGES="emp_games data_processing pid validation"
PACKAGES="emp_games data_processing pid validation smart_agent"
PACKAGE=$1
TAG=$2
if [[ ! " $PACKAGES " =~ $PACKAGE ]] || [[ ! " $TAG " =~ $TAG ]]; then
Expand All @@ -44,6 +45,7 @@ private_id_dfca_aggregator_package="s3://$one_docker_repo/private_id_dfca/privat
data_processing_repo="s3://$one_docker_repo/data_processing"
private_id_repo="s3://$one_docker_repo/pid"
validation_repo="s3://$one_docker_repo/validation"
smart_agent_repo="s3://$one_docker_repo/smart_agent"

if [ "$PACKAGE" = "emp_games" ]; then
cd binaries_out || exit
Expand Down Expand Up @@ -84,3 +86,8 @@ if [ "$PACKAGE" = "validation" ]; then
cd binaries_out || exit
aws s3 cp pc_pre_validation_cli "$validation_repo/pc_pre_validation_cli/${TAG}/pc_pre_validation_cli"
fi

if [ "$PACKAGE" = "smart_agent" ]; then
cd binaries_out || exit
aws s3 cp smart_agent_server "$smart_agent_repo/smart_agent_server/${TAG}/smart_agent_server"
fi
11 changes: 9 additions & 2 deletions upload_scripts/upload-binaries-using-onedocker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ set -e
PROG_NAME=$0
usage() {
cat << EOF >&2
Usage: $PROG_NAME <emp_games|data_processing|pid|validation> <tag> -c <config>
Usage: $PROG_NAME <emp_games|data_processing|pid|validation|smart_agent> <tag> -c <config>
package:
emp_games - extracts the binaries from fbpcs/emp-games docker image
data_processing - extracts the binaries from fbpcs/data-processing docker image
pid - extracts the binaries from private-id docker image
validation - extracts the binaries from the onedocker docker image
smart_agent - extracts the binaries from the onedocker docker image
tag: used to determine the subfolder/version in s3 for each binary
Expand All @@ -24,7 +25,7 @@ EOF
exit 1
}

PACKAGES="emp_games data_processing pid validation"
PACKAGES="emp_games data_processing pid validation smart_agent"
PACKAGE=$1
TAG=$2

Expand Down Expand Up @@ -104,3 +105,9 @@ cd binaries_out || exit
onedocker_upload validation/pc_pre_validation_cli pc_pre_validation_cli
cd .. || exit
fi

if [ "$PACKAGE" = "smart_agent" ]; then
cd binaries_out || exit
onedocker_upload smart_agent/smart_agent_server smart_agent_server
cd .. || exit
fi

0 comments on commit a6c0673

Please sign in to comment.