Skip to content
Snippets Groups Projects
Commit a05b1c9d authored by Sydney Anne Erickson's avatar Sydney Anne Erickson :chipmunk:
Browse files

Merge branch 'Anne/CI-Fix' into 'release'

Update download_cmix_binaries.sh

See merge request elixxir/integration!99
parents 1da2de60 1911cac1
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ installbinaries: ...@@ -52,7 +52,7 @@ installbinaries:
script: script:
- git clean -ffdx - git clean -ffdx
- mkdir -p ~/.elixxir - mkdir -p ~/.elixxir
- ./download_cmix_binaries.sh - ./download_cmix_binaries.sh l d
- mkdir -p /opt/xxnetwork/lib - mkdir -p /opt/xxnetwork/lib
- cp bin/libpowmosm75.so /opt/xxnetwork/lib/ - cp bin/libpowmosm75.so /opt/xxnetwork/lib/
- "chmod +x *" - "chmod +x *"
......
#!/usr/bin/env bash #!/usr/bin/env bash
# Get platform parameter # Get platform parameter
# === LINUX ===
if [[ $1 == "l" ]] ||[[ $1 == "linux" ]] || [[ -z $1 ]]; then if [[ $1 == "l" ]] ||[[ $1 == "linux" ]] || [[ -z $1 ]]; then
if [[ $2 == "d" ]]; then
BIN=".linux64?job=build" BIN=".linux64?job=build"
else
BIN=".linux64"
fi
echo "Platform set to Linux" echo "Platform set to Linux"
# === MACOS ===
elif [[ $1 == "m" ]] || [[ $1 == "mac" ]]; then elif [[ $1 == "m" ]] || [[ $1 == "mac" ]]; then
if [[ $2 == "d" ]]; then
BIN=".darwin64?job=build" BIN=".darwin64?job=build"
else
BIN=".darwin64"
fi
echo "Platform set to Mac" echo "Platform set to Mac"
else else
echo "Invalid platform argument: $1" echo "Invalid platform argument: $1"
exit 0 exit 0
...@@ -14,9 +28,11 @@ fi ...@@ -14,9 +28,11 @@ fi
# Set up the URL for downloading the binaries # Set up the URL for downloading the binaries
DEFAULTBRANCH=${DEFAULTBRANCH:="release"} DEFAULTBRANCH=${DEFAULTBRANCH:="release"}
REPOS_API=${REPOS_API:="https://gitlab.com/api/v4/projects/elixxir%2F"} if [[ $2 == "d" ]]; then
# Set up the gitlab access token REPOS_API=${REPOS_API:="https://gitlab.com/api/v4/projects/elixxir%2F"}
PATKEY=${PATKEY:="rBxQ6BvKP-eFxxeM3Ugm"} else
REPOS_API=${REPOS_API:="https://elixxir-bins.s3-us-west-1.amazonaws.com"}
fi
# Make the binaries directory # Make the binaries directory
download_path="$(pwd)/bin" download_path="$(pwd)/bin"
...@@ -38,6 +54,7 @@ echo "(Note: if you forced a branch, that is checked first!)" ...@@ -38,6 +54,7 @@ echo "(Note: if you forced a branch, that is checked first!)"
for BRANCH in $(echo "forcedbranch" $FBRANCH $FBRANCH2 $DEFAULTBRANCH); do for BRANCH in $(echo "forcedbranch" $FBRANCH $FBRANCH2 $DEFAULTBRANCH); do
echo "Attempting downloads from: $BRANCH" echo "Attempting downloads from: $BRANCH"
if [[ $2 == "d" ]]; then
BRANCH_URL=${BRANCH_URL:="jobs/artifacts/$BRANCH/raw/release"} BRANCH_URL=${BRANCH_URL:="jobs/artifacts/$BRANCH/raw/release"}
# Get URLs for artifacts from all relevant repos # Get URLs for artifacts from all relevant repos
UDB_URL=${UDB_URL:="${REPOS_API}user-discovery-bot/$BRANCH_URL/udb$BIN"} UDB_URL=${UDB_URL:="${REPOS_API}user-discovery-bot/$BRANCH_URL/udb$BIN"}
...@@ -47,43 +64,52 @@ for BRANCH in $(echo "forcedbranch" $FBRANCH $FBRANCH2 $DEFAULTBRANCH); do ...@@ -47,43 +64,52 @@ for BRANCH in $(echo "forcedbranch" $FBRANCH $FBRANCH2 $DEFAULTBRANCH); do
CLIENT_URL=${CLIENT_URL:="${REPOS_API}client/$BRANCH_URL/client$BIN"} CLIENT_URL=${CLIENT_URL:="${REPOS_API}client/$BRANCH_URL/client$BIN"}
SERVER_GPU_URL=${SERVER_GPU_URL:="${REPOS_API}server/$BRANCH_URL/server-cuda.linux64?job=build"} SERVER_GPU_URL=${SERVER_GPU_URL:="${REPOS_API}server/$BRANCH_URL/server-cuda.linux64?job=build"}
GPULIB_URL=${GPULIB_URL:="${REPOS_API}server/$BRANCH_URL/libpowmosm75.so?job=build"} GPULIB_URL=${GPULIB_URL:="${REPOS_API}server/$BRANCH_URL/libpowmosm75.so?job=build"}
else
UDB_URL=${UDB_URL:="${REPOS_API}/$BRANCH/udb$BIN"}
SERVER_URL=${SERVER_URL:="${REPOS_API}/$BRANCH/server$BIN"}
GW_URL=${GW_URL:="${REPOS_API}/$BRANCH/gateway$BIN"}
PERMISSIONING_URL=${PERMISSIONING_URL:="${REPOS_API}/$BRANCH/registration.stateless$BIN"}
CLIENT_URL=${CLIENT_URL:="${REPOS_API}/$BRANCH/client$BIN"}
fi
set -x set -x
# Silently download the UDB binary to the provisioning directory # Silently download the UDB binary to the provisioning directory
if [ ! -f $download_path/udb ] && [[ "$UDB_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/udb ] && [[ "$UDB_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/udb" ${UDB_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/udb" ${UDB_URL}
fi fi
# Silently download the Server binary to the provisioning directory # Silently download the Server binary to the provisioning directory
if [ ! -f $download_path/server ] && [[ "$SERVER_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/server ] && [[ "$SERVER_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/server" ${SERVER_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/server" ${SERVER_URL}
fi fi
# Silently download the Gateway binary to the provisioning directory # Silently download the Gateway binary to the provisioning directory
if [ ! -f $download_path/gateway ] && [[ "$GW_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/gateway ] && [[ "$GW_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/gateway" ${GW_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/gateway" ${GW_URL}
fi fi
# Silently download the permissioning binary to the provisioning directory # Silently download the permissioning binary to the provisioning directory
if [ ! -f $download_path/permissioning ] && [[ "$PERMISSIONING_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/permissioning ] && [[ "$PERMISSIONING_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/permissioning" ${PERMISSIONING_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/permissioning" ${PERMISSIONING_URL}
fi fi
# Silently download the permissioning binary to the provisioning directory # Silently download the permissioning binary to the provisioning directory
if [ ! -f $download_path/client ] && [[ "$CLIENT_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/client ] && [[ "$CLIENT_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/client" ${CLIENT_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/client" ${CLIENT_URL}
fi fi
if [[ $2 == "d" ]]; then
# Silently download the Server binary to the provisioning directory # Silently download the Server binary to the provisioning directory
if [ ! -f $download_path/server-cuda ] && [[ "$SERVER_GPU_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/server-cuda ] && [[ "$SERVER_GPU_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/server-cuda" ${SERVER_GPU_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/server-cuda" ${SERVER_GPU_URL}
fi fi
# Silently download the GPU Library to the provisioning directory # Silently download the GPU Library to the provisioning directory
if [ ! -f $download_path/libpowmosm75.so ] && [[ "$GPULIB_URL" != *"forcedbranch"* ]]; then if [ ! -f $download_path/libpowmosm75.so ] && [[ "$GPULIB_URL" != *"forcedbranch"* ]]; then
curl -s -f -L -H "PRIVATE-TOKEN: $PATKEY" -o "$download_path/libpowmosm75.so" ${GPULIB_URL} curl -s -f -L -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" -o "$download_path/libpowmosm75.so" ${GPULIB_URL}
fi fi
fi
set +x set +x
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment