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

Fix RVPS binary building & push image every merge to main #277

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .github/workflows/as-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push CoCoAS Image
name: Build and Push CoCoAS / RVPS Image

on:
push:
Expand All @@ -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
Expand All @@ -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
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
2 changes: 1 addition & 1 deletion attestation-service/attestation-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion attestation-service/rvps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion attestation-service/rvps/src/bin/rvps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use -c for short instead of -s?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default both storage and socket will use the same short flag -s atomatically, which will make the rvps process panic when launched. This is why a different short flag is defined here.

pub storage: String,

/// Socket addresses (IP:port) to listen on, e.g. 127.0.0.1:50003.
Expand Down
Loading