Parallel deploy (#1512)

* deploy dockerfile in a separate step

* don't double-deploy

* store the dockerfile

* fix paths

* but save the one in ci

* relative to wd

* maybe without ci

* separate attach

* actually copy to deploy

* don't need this step maybe

* Revert "don't need this step maybe"

This reverts commit ca6e742a14cda5e48a7f4df499664e124acbe675.


Former-commit-id: 62d9cfdf5090383731cefaf1f2dafb30eb486f1b
This commit is contained in:
2022-03-28 11:57:25 -07:00
committed by GitHub
parent 86e214e886
commit d3fc0a7f9e
3 changed files with 54 additions and 29 deletions
+52 -27
View File
@@ -60,21 +60,59 @@ jobs:
- checkout
- setup-tools
- setup-bazelrc
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- run:
name: Build servers
command: ./ci/build_servers_cci.sh
- store_artifacts:
path: ./deploy/shardok.tar.gz
- persist_to_workspace:
root: deploy
paths:
- shardok.tar.gz
- eagle_server_deploy.jar
- persist_to_workspace:
root: ci
paths:
- eagle_run.Dockerfile
deploy-shardok:
docker:
- image: nolen777/circleci-bazelisk:0.0.8
steps:
- attach_workspace:
at: deploy
- aws-s3/copy:
from: deploy/shardok.tar.gz
to: 's3://eagle0/servers/${CIRCLE_BRANCH}/'
arguments: "--metadata SHA=$(sha256sum deploy/shardok.tar.gz | cut -d' ' -f1)"
deploy-eagle:
docker:
- image: nolen777/circleci-bazelisk:0.0.8
resource_class: large
steps:
- attach_workspace:
at: deploy
- attach_workspace:
at: ci
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: true
- aws-ecr/ecr-login:
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
region: ${AWS_DEFAULT_REGION}
registry-id: AWS_ECR_REGISTRY_ID
- aws-ecr/build-image:
dockerfile: ./ci/eagle_run.Dockerfile
extra-build-args: '--compress'
@@ -88,26 +126,6 @@ jobs:
repo: eagle0
skip-when-tags-exist: false
- store_artifacts:
path: ./deploy/shardok.tar.gz
- persist_to_workspace:
root: deploy
paths:
- shardok.tar.gz
deploy:
docker:
- image: nolen777/circleci-bazelisk:0.0.8
steps:
- attach_workspace:
at: deploy
- aws-s3/copy:
from: deploy/shardok.tar.gz
to: 's3://eagle0/servers/${CIRCLE_BRANCH}/'
arguments: "--metadata SHA=$(sha256sum deploy/shardok.tar.gz | cut -d' ' -f1)"
workflows:
build-workflow:
jobs:
@@ -117,9 +135,16 @@ workflows:
- build:
context:
- bazel
- deploy:
- deploy-shardok:
requires:
- build # Only run deploy job once the build job has completed
- test # Only run if the test job is successful
context:
- bazel
- deploy-eagle:
requires:
- build # Only run deploy job once the build job has completed
- test # Only run if the test job is successful
context:
- bazel
+1 -1
View File
@@ -32,7 +32,7 @@ echo "Setting up Shardok files..."
/bin/cp -R ./bazel-bin/src/main/cpp/net/eagle0/shardok/shardok-inspector ./shardok/
echo "Copying eagle jar..."
/bin/cp -R ./bazel-bin/src/main/scala/net/eagle0/eagle/eagle_server_deploy.jar .
/bin/cp -R ./bazel-bin/src/main/scala/net/eagle0/eagle/eagle_server_deploy.jar ./deploy/
echo "tar & zip shardok files..."
/bin/tar cfh - shardok | /usr/bin/pigz > ./deploy/shardok.tar.gz
+1 -1
View File
@@ -1,5 +1,5 @@
FROM openjdk:17
COPY ./eagle_server_deploy.jar ./eagle_server_deploy.jar
COPY ./deploy/eagle_server_deploy.jar ./eagle_server_deploy.jar
ENTRYPOINT ["java", "-jar", "eagle_server_deploy.jar"]