Skip to content

Commit

Permalink
Generate SBOM(Software Bill of Materials) for docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
laoshanxi committed Mar 8, 2023
1 parent 837343b commit 7b512cc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-push-appmesh-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
context: .
file: Dockerfile
no-cache: true
attests: type=sbom
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-ubuntu-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
context: .
file: docker/Dockerfile.build_ubuntu
no-cache: true
# attests: type=sbom,generator=image
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/publish-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
strategy:
matrix:
include:
- arch: arm64
variant: v8
- arch: amd64
# - arch: arm64
# variant: v8

runs-on: ubuntu-latest
permissions:
Expand All @@ -38,9 +38,6 @@ jobs:
# with sigstore/fulcio when running outside of PRs.
id-token: write

env:
PLATFORM: linux/${{ matrix.arch }}${{ (matrix.variant != '' && format('/{0}', matrix.variant)) || '' }}

steps:
- name: Checkout Github code
uses: actions/checkout@v3
Expand All @@ -52,21 +49,24 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

# https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/
- name: build with ubuntu22
run: |
build_dir=${{ matrix.arch }}
docker run --rm --volume ${{ github.workspace }}:/workspace --workdir /workspace laoshanxi/appmesh:build_ubuntu22 /bin/sh -c "mkdir ubuntu22_$build_dir; cd ubuntu22_$build_dir; cmake ..; make -j4; make pack; ls; make test ARGS='-V'"
docker run --platform ${{ matrix.arch }} --rm --volume ${{ github.workspace }}:/workspace --workdir /workspace laoshanxi/appmesh:build_ubuntu22 /bin/sh -c "mkdir ubuntu22_$build_dir; cd ubuntu22_$build_dir; cmake ..; make -j4; make pack; ls; make test ARGS='-V'"
- name: build with ubuntu20
run: |
build_dir=${{ matrix.arch }}
docker run --rm --volume ${{ github.workspace }}:/workspace --workdir /workspace laoshanxi/appmesh:build_ubuntu20 /bin/sh -c "mkdir ubuntu20_$build_dir; cd ubuntu20_$build_dir; cmake ..; make -j4; make pack; ls; make test ARGS='-V'"
docker run --platform ${{ matrix.arch }} --rm --volume ${{ github.workspace }}:/workspace --workdir /workspace laoshanxi/appmesh:build_ubuntu20 /bin/sh -c "mkdir ubuntu20_$build_dir; cd ubuntu20_$build_dir; cmake ..; make -j4; make pack; ls; make test ARGS='-V'"
- name: build with ubuntu18
run: |
build_dir=${{ matrix.arch }}
docker run --rm --volume ${{ github.workspace }}:/workspace --workdir /workspace laoshanxi/appmesh:build_ubuntu18 /bin/sh -c "mkdir ubuntu18_$build_dir; cd ubuntu18_$build_dir; cmake ..; make -j4; make pack; ls; make test ARGS='-V'"
docker run --platform ${{ matrix.arch }} --rm --volume ${{ github.workspace }}:/workspace --workdir /workspace laoshanxi/appmesh:build_ubuntu18 /bin/sh -c "mkdir ubuntu18_$build_dir; cd ubuntu18_$build_dir; cmake ..; make -j4; make pack; ls; make test ARGS='-V'"
- name: Upload packages
uses: actions/upload-artifact@v3
Expand All @@ -82,10 +82,10 @@ jobs:
- build
if: ${{ github.event_name != 'pull_request' }}
steps:
#- name: Download arm64 packages
# uses: actions/download-artifact@v3
# with:
# name: arm64
- name: Download arm64 packages
uses: actions/download-artifact@v3
with:
name: arm64
- name: Download amd64 packages
uses: actions/download-artifact@v3
with:
Expand Down
22 changes: 13 additions & 9 deletions src/sdk/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@
with io.open(os.path.abspath(readme_path), mode="r", encoding="utf-8") as fh:
long_description = fh.read()

skip_versions = ["0.1.6"]
start_version = "0.2.0"


def get_version():
resp = requests.get("https://pypi.org/pypi/appmesh/json")
if resp.status_code == 200:
data = json.loads(resp.text)
if "info" in data and "version" in data["info"] :
version = data["info"]["version"]
version_list = list(str(int(version.replace(".", "")) + 1))
while len(version_list) < 3:
version_list = ["0"] + version_list
return '.'.join(version_list)
return "0.0.9"

data = json.loads(resp.text)
if "info" in data and "version" in data["info"]:
version = data["info"]["version"]
if version not in skip_versions:
version_list = list(str(int(version.replace(".", "")) + 1))
while len(version_list) < 3:
version_list = ["0"] + version_list
return ".".join(version_list)
return start_version


setuptools.setup(
Expand Down

0 comments on commit 7b512cc

Please sign in to comment.