From 4ab3c32211cf14297aa68829392ef3a45efaecf7 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Tue, 18 Jan 2022 18:08:59 -0600 Subject: [PATCH 1/7] build docker for arm64 --- .gitlab/.gitlab-ci.yml | 21 ++++++++++++++++++--- .gitlab/Dockerfile | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 4164ba8da..de38ac0c0 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -187,8 +187,7 @@ package for linux amd64: - "*.deb" - "*.rpm" -# Build a FB Docker image with CI/CD and push to the GitLab registry. -build container fb: +build amd container fb: stage: build needs: - "build for linux amd64" @@ -200,7 +199,23 @@ build container fb: - echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY} script: - tag=${CI_REGISTRY_IMAGE}/server:${CI_COMMIT_REF_SLUG} - - docker build --build-arg GO_VERSION=$GOVERSION -t $tag -f .gitlab/Dockerfile . + - docker build --build-arg GO_VERSION=$GOVERSION --build-arg ARCH=amd64 -t $tag -f .gitlab/Dockerfile . + - docker push $tag + - echo Created docker featurebase image with tag "$tag" + +build arm container fb: + stage: build + needs: + - "build for linux arm64" + tags: + - shell + rules: + - if: '$CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"' + before_script: + - echo "${DOCKER_DEPLOY_TOKEN}" | docker login -u ${DOCKER_DEPLOY_USER} --password-stdin ${CI_REGISTRY} + script: + - tag=${CI_REGISTRY_IMAGE}/server-arm:${CI_COMMIT_REF_SLUG} + - docker build --build-arg GO_VERSION=$GOVERSION --build-arg ARCH=arm64 -t $tag -f .gitlab/Dockerfile . - docker push $tag - echo Created docker featurebase image with tag "$tag" diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index b041f58ce..754087a7a 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /featurebase RUN apk add --no-cache curl jq COPY NOTICE . -COPY featurebase_linux_amd64 . +COPY featurebase_linux_${ARCH} . RUN chmod ugo+x . EXPOSE 10101 From ec76cb5b34f3a6fe3b29ee298ee57b32bbe1ef64 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Tue, 18 Jan 2022 18:14:51 -0600 Subject: [PATCH 2/7] added .deb & .rpm package for arm64 --- .gitlab/.gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index de38ac0c0..33470e1c7 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -187,6 +187,23 @@ package for linux amd64: - "*.deb" - "*.rpm" +package for linux arm64: + stage: build + image: golang:$GOVERSION + rules: + - if: '$CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"' + variables: + GOOS: "linux" + GOARCH: "arm64" + script: + - echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list + - apt update && apt install nfpm + - make package + artifacts: + paths: + - "*.deb" + - "*.rpm" + build amd container fb: stage: build needs: From b144c0e61c9f46dbd1cf78e6bd68f2664f470f44 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Wed, 19 Jan 2022 10:10:30 -0600 Subject: [PATCH 3/7] added ARG decl. --- .gitlab/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index 754087a7a..f7b9ba697 100644 --- a/.gitlab/Dockerfile +++ b/.gitlab/Dockerfile @@ -3,12 +3,14 @@ FROM alpine:3.14.2 LABEL maintainer "dev@molecula.com" LABEL org.opencontainers.image.authors="dev@molecula.com" +ARG ARCH + WORKDIR /featurebase RUN apk add --no-cache curl jq COPY NOTICE . -COPY featurebase_linux_${ARCH} . +COPY featurebase_linux_$ARCH . RUN chmod ugo+x . EXPOSE 10101 From bc589ee4eb0e46481ad87cc9d2d89a716e8a12d8 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Wed, 19 Jan 2022 10:13:11 -0600 Subject: [PATCH 4/7] when it fails, it should fail --- .gitlab/.gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 33470e1c7..92023b865 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -319,7 +319,6 @@ smoke test: - ./qa/scripts/teardownSmokeTest.sh needs: - job: build for linux arm64 - allow_failure: true artifacts: when: always paths: From c2c140aad4a45f218bfa0d4cbdc9f2940a946d23 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Wed, 19 Jan 2022 11:26:40 -0600 Subject: [PATCH 5/7] print out the url of the binary we are trying to get --- qa/scripts/utilCluster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qa/scripts/utilCluster.sh b/qa/scripts/utilCluster.sh index 769e84a49..e460f1f48 100644 --- a/qa/scripts/utilCluster.sh +++ b/qa/scripts/utilCluster.sh @@ -127,7 +127,7 @@ executeGeneralNodeConfigCommands() { # TODO handle different archs - echo "Getting featurebase binary..." + echo "Getting featurebase binary (https://gitlab.com/api/v4/projects/molecula%2Ffeaturebase/jobs/artifacts/${TF_VAR_branch}/raw/featurebase_linux_arm64?job=build%20for%20linux%20arm64)..." ssh -A -i ~/.ssh/gitlab-featurebase-ci.pem -o StrictHostKeyChecking=no ec2-user@${NODEIP} "curl --fail --header 'PRIVATE-TOKEN: ${TF_VAR_gitlab_token}' -o /home/ec2-user/featurebase_linux_arm64 https://gitlab.com/api/v4/projects/molecula%2Ffeaturebase/jobs/artifacts/${TF_VAR_branch}/raw/featurebase_linux_arm64?job=build%20for%20linux%20arm64" if (( $? != 0 )) then From bc89ca355364d99b448dcd43fa81f007a443b69f Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Fri, 21 Jan 2022 20:31:16 -0600 Subject: [PATCH 6/7] now with real private_subnets! --- qa/tf/ci/smoketest/main.tf | 2 +- qa/tf/gauntlet/samsung/main.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/tf/ci/smoketest/main.tf b/qa/tf/ci/smoketest/main.tf index 40f51a89a..5d600d1fa 100644 --- a/qa/tf/ci/smoketest/main.tf +++ b/qa/tf/ci/smoketest/main.tf @@ -10,5 +10,5 @@ module "ci-cluster" { vpc_id = "vpc-05a26a122f961dc2b" vpc_cidr_block = "10.0.0.0/16" vpc_public_subnets = ["subnet-066b4b922b54e51a2","subnet-037b8884269a69025","subnet-08482631514426210",] - vpc_private_subnets = ["subnet-050b1219d78f2db1b","subnet-07155281789c6d33b","subnet-0d623c769e086e46e",] + vpc_private_subnets = ["subnet-0319dde319380326f","subnet-0517ca9a646d80f88","subnet-05a7b685ed27eb1cf",] } \ No newline at end of file diff --git a/qa/tf/gauntlet/samsung/main.tf b/qa/tf/gauntlet/samsung/main.tf index f86b7db70..440f833ca 100644 --- a/qa/tf/gauntlet/samsung/main.tf +++ b/qa/tf/gauntlet/samsung/main.tf @@ -12,5 +12,5 @@ module "samsung-cluster" { vpc_id = "vpc-05a26a122f961dc2b" vpc_cidr_block = "10.0.0.0/16" vpc_public_subnets = ["subnet-066b4b922b54e51a2","subnet-037b8884269a69025","subnet-08482631514426210",] - vpc_private_subnets = ["subnet-050b1219d78f2db1b","subnet-0d623c769e086e46e","subnet-07155281789c6d33b",] + vpc_private_subnets = ["subnet-0319dde319380326f","subnet-0517ca9a646d80f88","subnet-05a7b685ed27eb1cf",] } \ No newline at end of file From 1721dd0dcf251c55e58a240bbec6fad736249934 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Mon, 24 Jan 2022 15:11:02 -0600 Subject: [PATCH 7/7] remove comments --- qa/scripts/runSamsungGauntlet.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/scripts/runSamsungGauntlet.sh b/qa/scripts/runSamsungGauntlet.sh index 4b10e0d7c..086bf0874 100644 --- a/qa/scripts/runSamsungGauntlet.sh +++ b/qa/scripts/runSamsungGauntlet.sh @@ -18,5 +18,5 @@ else fi $SCRIPT_DIR/setupSamsungGauntlet.sh -#$SCRIPT_DIR/testSamsungGauntlet.sh -#$SCRIPT_DIR/teardownSamsungGauntlet.sh +$SCRIPT_DIR/testSamsungGauntlet.sh +$SCRIPT_DIR/teardownSamsungGauntlet.sh