From f1480891d7f886b4cb06dc7434852c329474e3ed Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Thu, 4 Jan 2024 10:21:22 +0800 Subject: [PATCH 1/3] AS/RVPS: fix RVPS binary and log storage and socket parameter use a common short flag `-c` so the binary will panic when running. Signed-off-by: Xynnn007 --- attestation-service/attestation-service/src/lib.rs | 2 +- attestation-service/rvps/src/bin/rvps.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/attestation-service/attestation-service/src/lib.rs b/attestation-service/attestation-service/src/lib.rs index b39a47d87..0e54ad3be 100644 --- a/attestation-service/attestation-service/src/lib.rs +++ b/attestation-service/attestation-service/src/lib.rs @@ -179,7 +179,7 @@ impl AttestationService { let reference_data_map = self .get_reference_data(flattened_claims.keys()) .await - .map_err(|e| anyhow!("Generate reference data failed{:?}", e))?; + .map_err(|e| anyhow!("Generate reference data failed: {:?}", e))?; let evaluation_report = self .policy_engine diff --git a/attestation-service/rvps/src/bin/rvps.rs b/attestation-service/rvps/src/bin/rvps.rs index e83649117..f6175e405 100644 --- a/attestation-service/rvps/src/bin/rvps.rs +++ b/attestation-service/rvps/src/bin/rvps.rs @@ -19,7 +19,7 @@ const DEFAULT_STORAGE: &str = "LocalFs"; #[command(author, version, about, long_about = None)] pub struct Cli { /// Underlying storage engine that RVPS uses. - #[arg(short, long, default_value = DEFAULT_STORAGE)] + #[arg(short = 'c', long, default_value = DEFAULT_STORAGE)] pub storage: String, /// Socket addresses (IP:port) to listen on, e.g. 127.0.0.1:50003. From 97a5d84ab4276e772a2f9379768a84c112c0afd4 Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Thu, 4 Jan 2024 10:25:27 +0800 Subject: [PATCH 2/3] AS/RVPS: fix dockerfile LABEL Signed-off-by: Xynnn007 --- attestation-service/rvps/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attestation-service/rvps/Dockerfile b/attestation-service/rvps/Dockerfile index 3a73215f6..938ab1a7a 100644 --- a/attestation-service/rvps/Dockerfile +++ b/attestation-service/rvps/Dockerfile @@ -14,7 +14,7 @@ RUN cargo install --bin rvps --path attestation-service/rvps FROM debian -LABEL org.opencontainers.image.source="https://github.com/confidential-containers/attestation-service" +LABEL org.opencontainers.image.source="https://github.com/confidential-containers/kbs" COPY --from=builder /usr/local/cargo/bin/rvps /usr/local/bin/rvps From 44927780250595917110ffcb6bf43a2efefba765 Mon Sep 17 00:00:00 2001 From: Xynnn007 Date: Thu, 4 Jan 2024 10:25:47 +0800 Subject: [PATCH 3/3] ci: build RVPS image every merge to main Signed-off-by: Xynnn007 --- .github/workflows/as-build-and-push.yaml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/as-build-and-push.yaml b/.github/workflows/as-build-and-push.yaml index ca113b842..8a3f474e4 100644 --- a/.github/workflows/as-build-and-push.yaml +++ b/.github/workflows/as-build-and-push.yaml @@ -1,4 +1,4 @@ -name: Build and Push CoCoAS Image +name: Build and Push CoCoAS / RVPS Image on: push: @@ -8,6 +8,19 @@ on: jobs: build_and_push: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - docker_file: attestation-service/Dockerfile.as-grpc + tag: coco-as-grpc + name: gRPC CoCo-AS + - docker_file: attestation-service/Dockerfile.as-restful + tag: coco-as-restful + name: RESTful CoCo-AS + - docker_file: attestation-service/rvps/Dockerfile + tag: rvps + name: RVPS steps: - name: Checkout code @@ -23,12 +36,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build gRPC CoCo-AS Container Image + - name: Build ${{ matrix.name }} Container Image run: | commit_sha=${{ github.sha }} - DOCKER_BUILDKIT=1 docker build -t ghcr.io/confidential-containers/staged-images/coco-as-grpc:${commit_sha} -t ghcr.io/confidential-containers/staged-images/coco-as-grpc:latest . -f attestation-service/Dockerfile.as-grpc --push - - - name: Build RESTful CoCo-AS Container Image - run: | - commit_sha=${{ github.sha }} - DOCKER_BUILDKIT=1 docker build -t ghcr.io/confidential-containers/staged-images/coco-as-restful:${commit_sha} -t ghcr.io/confidential-containers/staged-images/coco-as-restful:latest . -f attestation-service/Dockerfile.as-restful --push \ No newline at end of file + DOCKER_BUILDKIT=1 docker build -t ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:${commit_sha} -t ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:latest . -f ${{ matrix.docker_file }} --push