diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 09987cadd..30695ad6c 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -201,8 +201,24 @@ package for linux amd64: - "*.deb" - "*.rpm" -# Build a FB Docker image with CI/CD and push to the GitLab registry. -build container fb: +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: - "build for linux amd64" @@ -214,7 +230,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" @@ -303,7 +335,6 @@ smoke test: - ./qa/scripts/teardownSmokeTest.sh needs: - job: build for linux arm64 - allow_failure: true artifacts: when: always paths: diff --git a/.gitlab/Dockerfile b/.gitlab/Dockerfile index b041f58ce..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_amd64 . +COPY featurebase_linux_$ARCH . RUN chmod ugo+x . EXPOSE 10101 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 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 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