Skip to content

Commit

Permalink
Fix container job release for 3.x (microsoft#5477)
Browse files Browse the repository at this point in the history
  • Loading branch information
jumaffre authored Jul 25, 2023
1 parent a67a077 commit 7e0d7a3
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
echo "tag=${GITHUB_REF#refs/tags/ccf-}" >> $GITHUB_OUTPUT
id: tref

- name: Build ${{ matrix.type }} container for ${{ matrix.platform }}${{ matrix.run_js && ', (JS)' || '' }}
run: docker build -f docker/app_${{ matrix.type }} . --build-arg="platform=${{ matrix.platform }}" --build-arg="ansible_vars=ccf_ver=${{ steps.tref.outputs.tag }} ${{ matrix.run_js && 'run_js=true' || '' }}" -t $ACR_REGISTRY/public/ccf/app/${{ matrix.type }}${{ matrix.run_js && '-js' || '' }}:${{ steps.tref.outputs.tag }}-${{ matrix.platform }}
- name: Build ${{ matrix.type }} container for ${{ matrix.platform }}${{ matrix.run_js && ', (JS)' || '' }} using clang ${{ matrix.clang_version }}
run: docker build -f docker/app_${{ matrix.type }} . --build-arg="clang_version=${{ matrix.clang_version }}" --build-arg="platform=${{ matrix.platform }}" --build-arg="ansible_vars=ccf_ver=${{ steps.tref.outputs.tag }} ${{ matrix.run_js && 'run_js=true' || '' }}" -t $ACR_REGISTRY/public/ccf/app/${{ matrix.type }}${{ matrix.run_js && '-js' || '' }}:${{ steps.tref.outputs.tag }}-${{ matrix.platform }}

- name: Log in
run: docker login -u $ACR_TOKEN_NAME -p ${{ secrets.ACR_APP_PUSH_TOKEN_PASSWORD }} $ACR_REGISTRY
Expand Down
2 changes: 1 addition & 1 deletion docker/app_dev
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY getting_started/setup_vm/ /tmp/setup_vm/
RUN apt update \
&& apt install -y ansible software-properties-common bsdmainutils dnsutils \
&& cd /tmp/setup_vm \
&& ansible-playbook app-dev.yml --extra-vars "$ansible_vars" --extra-vars "platform=${platform}" \
&& ansible-playbook app-dev.yml --extra-vars "$ansible_vars" --extra-vars "platform=${platform}" --extra-vars "clang_version=${clang_version}" \
&& rm -rf /tmp/* \
&& apt remove -y ansible software-properties-common \
&& apt -y autoremove \
Expand Down
2 changes: 1 addition & 1 deletion docker/app_run
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY getting_started/setup_vm/ /tmp/setup_vm/
RUN apt update \
&& apt install -y ansible software-properties-common curl bsdmainutils dnsutils \
&& cd /tmp/setup_vm \
&& ansible-playbook app-run.yml --extra-vars "$ansible_vars" --extra-vars "platform=${platform}" \
&& ansible-playbook app-run.yml --extra-vars "$ansible_vars" --extra-vars "platform=${platform}" --extra-vars "clang_version=${clang_version}" \
&& rm -rf /tmp/* \
&& apt remove -y ansible software-properties-common curl \
&& apt -y autoremove \
Expand Down
15 changes: 13 additions & 2 deletions getting_started/setup_vm/app-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
platform: "sgx"
clang_version: "11"
tasks:
- import_role:
name: llvm_repo
tasks_from: install.yml
when: clang_version == "15"
- import_role:
name: intel
tasks_from: sgx-psw.yml
Expand All @@ -15,14 +19,21 @@
- import_role:
name: az_dcap
tasks_from: install.yml

# If OE is already installed, we don't want to install hostverify as they are mutually
# exclusive. Non-SGX CCF builds can use either of them.
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- import_role:
name: openenclave
tasks_from: binary_install.yml
when: platform == "sgx"
when: (platform == "sgx") or ("open-enclave" in ansible_facts.packages)
- import_role:
name: openenclave
tasks_from: install_host_verify.yml
when: platform != "sgx"
when: (platform != "sgx") and ("open-enclave" not in ansible_facts.packages)

- import_role:
name: ccf_build
tasks_from: install.yml
Expand Down
12 changes: 12 additions & 0 deletions getting_started/setup_vm/app-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
platform: "sgx"
clang_version: "11"
tasks:
- import_role:
name: llvm_repo
tasks_from: install.yml
when: clang_version == "15"
- import_role:
name: intel
tasks_from: sgx-psw.yml
Expand All @@ -15,6 +19,14 @@
- import_role:
name: az_dcap
tasks_from: install.yml
- import_role:
name: openenclave
tasks_from: binary_install.yml
when: platform == "sgx"
- import_role:
name: openenclave
tasks_from: install_host_verify.yml
when: platform != "sgx"
- import_role:
name: ccf_install
tasks_from: deb_install.yml

0 comments on commit 7e0d7a3

Please sign in to comment.