Skip to content

Commit

Permalink
add debug logging, ecr push and cache
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Jan 29, 2025
1 parent 4b1256b commit 93d4b14
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/civ2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ jobs:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

# TODO add ECR
# # https://github.com/docker/login-action#aws-public-elastic-container-registry-ecr
# - name: Login to ECR
# uses: docker/login-action@v3
# with:
# registry: ${{ inputs.AWS_ECR_REGISTRY }}
# username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
# password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
# env:
# AWS_REGION: ${{ inputs.AWS_REGION }}
# https://github.com/docker/login-action#aws-public-elastic-container-registry-ecr
- name: Login to ECR
uses: docker/login-action@v3
with:
registry: 707767160287.dkr.ecr.us-east-1.amazonaws.com
username: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
password: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: us-east-1

- name: Checkout
uses: actions/checkout@v4
Expand Down
28 changes: 15 additions & 13 deletions docker/orthanc/AmazonLinux2Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ COPY build-or-download.sh /scripts

# ===> https://github.com/orthanc-server/orthanc-builder/blob/11d6930/docker/orthanc/Dockerfile

# TODO is this part needed?
FROM orthanc-builder-base
# FROM orthanc-builder-base
ARG ARG_AWS_ACCESS_KEY_ID
ARG ARG_AWS_SECRET_ACCESS_KEY
ENV AWS_ACCESS_KEY_ID=$ARG_AWS_ACCESS_KEY_ID
Expand All @@ -167,20 +166,20 @@ ARG PLATFORM=linux/amd64
ARG STABLE_OR_UNSTABLE=stable


FROM jodogne/wasm-builder:3.1.49 AS wasm-builder-base-amd64
# FROM jodogne/wasm-builder:3.1.49 AS wasm-builder-base-amd64

ARG ARG_AWS_ACCESS_KEY_ID
ARG ARG_AWS_SECRET_ACCESS_KEY
ENV AWS_ACCESS_KEY_ID=$ARG_AWS_ACCESS_KEY_ID
ENV AWS_SECRET_ACCESS_KEY=$ARG_AWS_SECRET_ACCESS_KEY
ARG PREFER_DOWNLOADS=1
ARG ENABLE_UPLOAD=0
ARG PLATFORM=linux/amd64
ARG STABLE_OR_UNSTABLE=stable
# ARG ARG_AWS_ACCESS_KEY_ID
# ARG ARG_AWS_SECRET_ACCESS_KEY
# ENV AWS_ACCESS_KEY_ID=$ARG_AWS_ACCESS_KEY_ID
# ENV AWS_SECRET_ACCESS_KEY=$ARG_AWS_SECRET_ACCESS_KEY
# ARG PREFER_DOWNLOADS=1
# ARG ENABLE_UPLOAD=0
# ARG PLATFORM=linux/amd64
# ARG STABLE_OR_UNSTABLE=stable


RUN mkdir -p /.aws && echo region=eu-west-1 > /.aws/credentials
RUN DEBIAN_FRONTEND=noninteractive && apt-get --assume-yes update && apt-get -y --fix-broken install && DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install curl awscli
# RUN mkdir -p /.aws && echo region=eu-west-1 > /.aws/credentials
# RUN DEBIAN_FRONTEND=noninteractive && apt-get --assume-yes update && apt-get -y --fix-broken install && DEBIAN_FRONTEND=noninteractive apt-get --assume-yes install curl awscli

########################## Orthanc

Expand Down Expand Up @@ -506,3 +505,6 @@ RUN groupadd --system orthanc --gid=999; \
chown -R orthanc:orthanc /usr/share/orthanc/plugins-available; \
echo not-generated > /etc/hostid; \
chown orthanc:orthanc /etc/hostid

# enable debug logging
ENV VERBOSE_ENABLED=true
7 changes: 5 additions & 2 deletions local-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ if [[ $useBuildx == "true" ]]; then
from_cache_arg_builder_vcpkg_google="--cache-from=orthancteam/orthanc-builder-base:cache-vcpkg-google-$BASE_BUILDER_IMAGE_TAG"
to_cache_arg_builder_vcpkg_google="--cache-to=orthancteam/orthanc-builder-base:cache-vcpkg-google-$BASE_BUILDER_IMAGE_TAG"

from_cache_arg="--cache-from=orthancteam/orthanc-builder-base:cache-main-$BASE_BUILDER_IMAGE_TAG"
to_cache_arg="--cache-to=orthancteam/orthanc-builder-base:cache-main-$BASE_BUILDER_IMAGE_TAG"
# from_cache_arg="--cache-from=orthancteam/orthanc-builder-base:cache-main-$BASE_BUILDER_IMAGE_TAG"
# to_cache_arg="--cache-to=orthancteam/orthanc-builder-base:cache-main-$BASE_BUILDER_IMAGE_TAG"
from_cache_arg="--cache-from=type=registry,ref=707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-orthanc:cache"
to_cache_arg="--cache-to=type=registry,ref=707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-orthanc:cache,mode=max,image-manifest=true,oci-mediatypes=true"

# when building in CI, use buildx
build="buildx build"
Expand Down Expand Up @@ -196,6 +198,7 @@ if [[ $step == "push" ]]; then
# docker push orthancteam/orthanc-pre-release:$final_tag
docker tag orthancteam/orthanc:$currentTag quay.io/cdis/gen3-orthanc:$final_tag
docker push quay.io/cdis/gen3-orthanc:$final_tag
docker push 707767160287.dkr.ecr.us-east-1.amazonaws.com/gen3/gen3-orthanc:$final_tag

exit 0
else
Expand Down

0 comments on commit 93d4b14

Please sign in to comment.