Skip to content

Commit

Permalink
add rust-sgx
Browse files Browse the repository at this point in the history
  • Loading branch information
jgreat committed Nov 13, 2024
1 parent 2a2df01 commit dc8f771
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 65 deletions.
98 changes: 35 additions & 63 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
tags:
- 'v*.*.*'

# env:
# PUSH: ${{ github.event_name == 'pull_request' && 'false' || 'true' }}
env:
PULL_REQUEST: ${{ github.event_name == 'pull_request' && 'false' || 'true' }}

concurrency:
group: ${{ github.workflow }}
Expand All @@ -28,6 +28,9 @@ jobs:
uses: mobilecoinofficial/gh-actions/lint-docker@v0

docker-rust-base:
needs:
- lint-actions
- lint-docker
strategy:
matrix:
runner:
Expand All @@ -40,7 +43,7 @@ jobs:

- name: Docker rust-base
id: build
uses: mobilecoinofficial/gh-actions/docker@4e8da3b222fe4dcf5a8d7ad04dd37b1c43c8c7a5
uses: mobilecoinofficial/gh-actions/docker@ce66543a382e20624b6db7f5ffc1226227114871
with:
dockerfile: Dockerfile.rust-base
images: mobilecoin/rust-base
Expand All @@ -55,7 +58,7 @@ jobs:
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
uses: mobilecoinofficial/gh-actions/upload-artifact@v0
with:
name: digests-rust-base-${{ runner.arch }}
path: /tmp/digests/*
Expand All @@ -68,7 +71,7 @@ jobs:
- docker-rust-base
steps:
- name: Merge and Tag Digests
uses: mobilecoinofficial/gh-actions/docker-merge-digests@8ed6075d8f78f3c63f6836526448c36a20c137d0
uses: mobilecoinofficial/gh-actions/docker-merge-digests@ce66543a382e20624b6db7f5ffc1226227114871
with:
digest_artifact_prefix: digests-rust-base
images: mobilecoin/rust-base
Expand All @@ -79,65 +82,34 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Download digests
# uses: actions/download-artifact@v4
# with:
# path: /tmp/digests
# pattern: digests-rust-base*
# merge-multiple: true

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: mobilecoin/rust-base
# tags: |
# type=semver,pattern=v{{version}}
# type=sha

# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Create manifest list and push
# shell: bash
# working-directory: /tmp/digests
# run: |
# # Grab the tags from metadata-action ENV with jq
# # Gather all the digests for the images pushed (names of empty files stored as artifacts)
# # Push a manifest (tag) with all the digests to dockerhub
# docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
# $(printf 'mobilecoin/rust-base@sha256:%s ' *)


# docker-rust-sgx:
# needs:
# - docker-rust-base
# runs-on: mco-dev-small-x64
# steps:
# - name: Checkout
# uses: mobilecoinofficial/gh-actions/checkout@v0
docker-rust-sgx:
needs:
- docker-rust-base-merge
runs-on: mco-dev-small-x64
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Short Sha
id: short_sha
uses: mobilecoinofficial/gh-actions/short-sha@ce66543a382e20624b6db7f5ffc1226227114871

- name: Docker rust-sgx
id: build
uses: mobilecoinofficial/gh-actions/docker@ce66543a382e20624b6db7f5ffc1226227114871
with:
dockerfile: Dockerfile.rust-sgx
flavor: latest=true
images: mobilecoin/rust-sgx
tags: |
type=semver,pattern=v{{version}}
type=sha
build_args: |
BASE_IMAGE_TAG=${{ steps.short_sha.outputs.short_sha }}
push: true
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# - name: Docker rust-sgx
# uses: mobilecoinofficial/gh-actions/docker@v0
# with:
# flavor: latest=true
# dockerfile: Dockerfile.rust-sgx
# images: mobilecoin/rust-sgx
# tags: |
# type=ref,event=branch
# type=semver,pattern=v{{version}}
# type=semver,pattern=v{{major}}.{{minor}}
# type=semver,pattern=v{{major}}
# type=sha
# push: true
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

# docker-fat-builder:
# needs:
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.fat-builder
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# "FROM mobilecoin/rust-sgx:latest" as mobilecoin/rust-sgx-builder:latest

ARG BASE_IMAGE=rust-base
FROM mobilecoin/${BASE_IMAGE}:latest
ARG BASE_IMAGE_TAG=latest
FROM mobilecoin/${BASE_IMAGE}:${BASE_IMAGE_TAG}
ARG TARGETARCH

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.rust-sgx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

# Rust with SGX libraries
# Note: only works for x86_64/amd64 and is intended to be built immediately after the rust-base image.
FROM mobilecoin/rust-base:latest
ARG BASE_IMAGE_TAG=latest
FROM mobilecoin/rust-base:${BASE_IMAGE_TAG}

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

Expand Down

0 comments on commit dc8f771

Please sign in to comment.