Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename App and CI container images #3839

Merged
merged 14 commits into from
May 17, 2022
Merged
2 changes: 1 addition & 1 deletion .azure-pipelines-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trigger:

jobs:
- job: build_and_publish_docs
container: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
container: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
pool:
vmImage: ubuntu-20.04

Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines-v8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ parameters:

jobs:
- job: build_v8
container: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
container: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
pool: 1es-dv4-focal

strategy:
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ schedules:
resources:
containers:
- container: nosgx
image: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
image: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /dev/shm:/tmp/ccache -v /lib/modules:/lib/modules:ro

- container: sgx
image: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
image: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /dev/shm:/tmp/ccache -v /lib/modules:/lib/modules:ro

variables:
Expand Down
4 changes: 2 additions & 2 deletions .daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ schedules:
resources:
containers:
- container: nosgx
image: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
image: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --cap-add SYS_PTRACE -v /dev/shm:/tmp/ccache

- container: sgx
image: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
image: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /dev/shm:/tmp/ccache

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
checks:
runs-on: ubuntu-latest
container: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
container: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1

steps:
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
id: tref

- name: Build CCF CI container
run: docker build -f docker/ccf_ci . -t $ACR_REGISTRY/ccf-sgx-ci:${{steps.tref.outputs.tag}}
run: docker build -f docker/ccf_ci . -t $ACR_REGISTRY/ccf/ci/sgx:${{steps.tref.outputs.tag}}

- name: Log in
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_CI_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Push CI container
run: docker push $ACR_REGISTRY/ccf-sgx-ci:${{steps.tref.outputs.tag}}
run: docker push $ACR_REGISTRY/ccf/ci/sgx:${{steps.tref.outputs.tag}}
26 changes: 13 additions & 13 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Build and Publish Release Containers to ACR"
name: "Build and Publish SGX Release Containers to ACR"

on:
release:
Expand All @@ -19,23 +19,23 @@ jobs:
run: echo "##[set-output name=tag;]${GITHUB_REF#refs/tags/ccf-}"
id: tref

- name: Build App Dev container
run: docker build -f docker/app_dev . --build-arg="extra_vars=--extra-vars ccf_ver=${{steps.tref.outputs.tag}}" -t $ACR_REGISTRY/ccf-sgx-app-dev:${{steps.tref.outputs.tag}} -t $ACR_REGISTRY/ccf-sgx-app-dev:latest
- name: Build App Dev SGX container
run: docker build -f docker/app_dev . --build-arg="extra_vars=--extra-vars ccf_ver=${{steps.tref.outputs.tag}}" -t $ACR_REGISTRY/public/ccf/app/dev:${{steps.tref.outputs.tag}}-sgx -t $ACR_REGISTRY/public/ccf/app/dev:latest

- name: Build App Run container
run: docker build -f docker/app_run . --build-arg="extra_vars=--extra-vars ccf_ver=${{steps.tref.outputs.tag}}" -t $ACR_REGISTRY/ccf-sgx-app-run:${{steps.tref.outputs.tag}} -t $ACR_REGISTRY/ccf-sgx-app-run:latest
- name: Build App Run SGX container
run: docker build -f docker/app_run . --build-arg="extra_vars=--extra-vars ccf_ver=${{steps.tref.outputs.tag}}" -t $ACR_REGISTRY/public/ccf/app/run:${{steps.tref.outputs.tag}}-sgx -t $ACR_REGISTRY/public/ccf/app/run:latest

- name: Log in
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_APP_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY

- name: Push App Dev container
run: docker push $ACR_REGISTRY/ccf-sgx-app-dev:${{steps.tref.outputs.tag}}
- name: Push App Dev SGX container
run: docker push $ACR_REGISTRY/public/ccf/app/dev:${{steps.tref.outputs.tag}}-sgx

- name: Push App Run container
run: docker push $ACR_REGISTRY/ccf-sgx-app-run:${{steps.tref.outputs.tag}}
- name: Push App Run SGX container
run: docker push $ACR_REGISTRY/public/ccf/app/run:${{steps.tref.outputs.tag}}-sgx

- name: Push App Dev latest container
run: docker push $ACR_REGISTRY/ccf-sgx-app-dev:latest
- name: Push App Dev SGX latest container
run: docker push $ACR_REGISTRY/public/ccf/app/dev:latest

- name: Push App Run latest container
run: docker push $ACR_REGISTRY/ccf-sgx-app-run:latest
- name: Push App Run SGX latest container
run: docker push $ACR_REGISTRY/public/ccf/app/run:latest
2 changes: 1 addition & 1 deletion .multi-thread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pr:
resources:
containers:
- container: sgx
image: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
image: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /dev/shm:/tmp/ccache

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .stress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ schedules:
resources:
containers:
- container: sgx
image: ccfmsrc.azurecr.io/ccf-sgx-ci:oe-0.17.7-0-acr
image: ccfmsrc.azurecr.io/ccf/ci/sgx:oe-0.17.7-1
options: --publish-all --cap-add NET_ADMIN --cap-add NET_RAW --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v /dev/sgx:/dev/sgx -v /dev/shm:/tmp/ccache

jobs:
Expand Down
4 changes: 2 additions & 2 deletions doc/contribute/build_ccf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ Although CCF's unit tests can be run through ``ctest`` directly, the end-to-end
Build Older Versions of CCF
---------------------------

Building older versions of CCF may require a different toolchain than the one used to build the current ``main`` branch (e.g. 1.x CCF releases are built with `clang-8`). To build an old version of CCF locally without having to install another toolchain that may conflict with the current one, it is recommended to use the ``ccfciteam/ccf-ci`` docker image (now ``ccfmsrc.azurecr.io/ccf-sgx-ci``). The version tag of the ``cci-ci`` (now ``ccf-sgx-ci``) image used to build the old version can be found in the :ccf_repo:`.azure-pipelines.yml` YAML file (under ``resources:container:image``).
Building older versions of CCF may require a different toolchain than the one used to build the current ``main`` branch (e.g. 1.x CCF releases are built with `clang-8`). To build an old version of CCF locally without having to install another toolchain that may conflict with the current one, it is recommended to use the ``ccfciteam/ccf-ci`` docker image (now ``ccfmsrc.azurecr.io/ccf/ci/sgx``). The version tag of the ``cci-ci`` (now ``ccf/ci/sgx``) image used to build the old version can be found in the :ccf_repo:`.azure-pipelines.yml` YAML file (under ``resources:container:image``).

.. code-block:: bash

$ export CCF_CI_IMAGE_TAG="oe0.17.2-clang-8" # e.g. building CCF 1.0.15
$ export LOCAL_CCF_CHECKOUT_PATH=/path/to/local/ccf/checkout
$ cd $LOCAL_CCF_CHECKOUT_PATH
$ git checkout ccf-1.0.15 # e.g. building CCF 1.0.15
$ docker run -ti --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v $LOCAL_CCF_CHECKOUT_PATH:/CCF ccfmsrc.azurecr.io/ccf-sgx-ci:$CCF_CI_IMAGE_TAG bash
$ docker run -ti --device /dev/sgx_enclave:/dev/sgx_enclave --device /dev/sgx_provision:/dev/sgx_provision -v $LOCAL_CCF_CHECKOUT_PATH:/CCF ccfmsrc.azurecr.io/ccf/ci/sgx:$CCF_CI_IMAGE_TAG bash
# container started, following lines are in container
$ cd CCF/
$ mkdir build_docker && cd build_docker
Expand Down
8 changes: 4 additions & 4 deletions doc/contribute/build_images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ CCF build images are produced by running the :ccf_repo:`docker/ccf_ci` Docker fi

.. code-block:: bash

$ docker pull ccfmsrc.azurecr.io/ccf-sgx-ci:<tag>
$ docker pull ccfmsrc.azurecr.io/ccf/ci/sgx:<tag>

Pushing a git tag of the form ``ccf_ci_image/$TAG`` will trigger the :ccf_repo:`.github/workflows/ci-containers.yml` workflow that builds and pushes a new ``ccfmsrc.azurecr.io/ccf-sgx-ci:$TAG`` image.
Pushing a git tag of the form ``ccf_ci_image/$TAG`` will trigger the :ccf_repo:`.github/workflows/ci-containers.yml` workflow that builds and pushes a new ``ccfmsrc.azurecr.io/ccf/ci/sgx:$TAG`` image.

That image can then be used in CI and CD pipelines.

Expand All @@ -22,7 +22,7 @@ The ``ccfmsrc.azurecr.io`` Azure Container Registry (ACR) has been setup so that
$ az account set --subscription CCF
$ az acr update --name ccfmsrc --anonymous-pull-enabled

The ``ci-push-token`` has been setup so that only authorised users (in this case the :ccf_repo:`.github/workflows/ci-containers.yml` workflow) can push new ``ccf-sgx-ci`` images:
The ``ci-push-token`` has been setup so that only authorised users (in this case the :ccf_repo:`.github/workflows/ci-containers.yml` workflow) can push new ``ccf/ci/sgx`` images:

.. code-block:: bash

Expand All @@ -31,7 +31,7 @@ The ``ci-push-token`` has been setup so that only authorised users (in this case
# Create d map
$ az acr scope-map create --name ci-push --registry ccfmsrc --description "Push CCF CI images"
# Add repository, even before repository is created
$ az acr scope-map update --name ci-push --registry ccfmsrc --add-repository ccf-sgx-ci content/write content/read
$ az acr scope-map update --name ci-push --registry ccfmsrc --add-repository ccf/ci/sgx content/write content/read
# Create token, outputs password to add as GitHub ACR_CI_PUSH_TOKEN_PASSWORD secret
$ az acr token create --name ci-push-token --registry ccfmsrc --scope-map ci-push

Expand Down