Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

adjust pipeline #23

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build Pipeline for Test
'on':
on:
- pull_request
concurrency:
group: ${{ github.head_ref || github.run_id }}
Expand Down
35 changes: 20 additions & 15 deletions .github/workflows/build_push_ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ name: Build and Push docker image to ECR
on:
push:
branches:
- staging
- vlad/ora-190-ensure-all-repos-are-deployable-on-aws-cloud-with-a-merge
- main
pull_request:

concurrency:
group: ${{ github.ref }}
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
deploy-staging:
build-push:
name: Build and Push docker image
runs-on: ubuntu-latest
environment: staging

steps:
- name: Checkout
Expand All @@ -33,22 +32,28 @@ jobs:
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push image to Amazon ECR
id: compute-node-build-image
id: build-push-image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: upshot-compute-node-staging
IMAGE_TAG: ${{ github.sha }}
ECR_REPOSITORY: ${{github.event.repository.name}} # Naming convention: ECR registry name == GITHUB repo name
MAIN_BRANCH: main # Images from this branch will be tagged as "latest"
run: |
IMAGE_TAG="${GITHUB_SHA:0:8}"
EXTRA_IMAGE_TAGS="dev-latest"

#! Add latest tag only if on MAIN_BRANCH branch
if [[ ${GITHUB_REF} == "refs/heads/${MAIN_BRANCH}" ]]; then
EXTRA_IMAGE_TAGS="${EXTRA_IMAGE_TAGS};latest"
fi

# Build a docker container and push it to ECR so that it can be deployed to ECS.
# To build it with particular BLS_EXTENSION version pass --build-arg "BLS_EXTENSION_VER=RELEASE_NAME"
# If BLS_EXTENSION_VER is not passed will be built with the latest available version
docker build -f docker/Dockerfile \
--build-arg "GH_TOKEN=${{ secrets.GHCR_TOKEN }}" \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> "$GITHUB_OUTPUT"

# Tag and push with latest
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest

# Build and PUSH additional tags
for tag in $(echo $EXTRA_IMAGE_TAGS| tr ";" "\n"); do
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$tag
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$tag
done
25 changes: 0 additions & 25 deletions .github/workflows/docker.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ RUN apt update && \
unzip \
ca-certificates \
gh && \
rm -rf /var/cache/apt/*
rm -rf /var/cache/apt/* && \
python3 -m pip install --upgrade pip
# libssl-dev \ # - temporary use libssl 1.1 TODO: Should use fresher libssl

# libssl 1.1
Expand All @@ -37,9 +38,8 @@ RUN GOMPLATE_VER="v3.11.6" && \
chmod 755 /usr/local/bin/gomplate

# get the runtime
RUN curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/v0.3.1/blockless-runtime.ubuntu-20.04.x86_64.tar.gz
RUN mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime
RUN python3 -m pip install --upgrade pip
RUN curl -o ./runtime.tar.gz -sSL https://github.com/blocklessnetwork/runtime/releases/download/v0.3.1/blockless-runtime.ubuntu-20.04.x86_64.tar.gz && \
mkdir /app/runtime && tar -xvkf ./runtime.tar.gz -C /app/runtime

ARG GH_TOKEN
ARG BLS_EXTENSION_VER
Expand Down
Loading