Skip to content

Commit

Permalink
fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
mmguero committed Feb 24, 2024
1 parent 68d38a4 commit ef4234b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 86 deletions.
64 changes: 22 additions & 42 deletions .github/workflows/monkeyplug-build-push-vosk-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ jobs:
-
name: Set up QEMU
id: setup-qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Log in to registry
id: registry-login
uses: redhat-actions/podman-login@v1
name: Set up Docker Buildx
id: setup-docker-buildx
uses: docker/setup-buildx-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
driver-opts: |
image=moby/buildkit:master
-
name: Extract tag name
shell: bash
Expand All @@ -93,43 +92,24 @@ jobs:
/usr/local/share/boost \
"$AGENT_TOOLSDIRECTORY" || true
-
name: Build (VOSK)
id: build-vosk-image
uses: redhat-actions/buildah-build@v2
name: ghcr.io login
id: ghcr-io-login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push Monkeyplug (VOSK) image
id: build-and-push
uses: docker/build-push-action@v5
with:
image: ${{ env.IMAGE_NAME }}
tags: vosk-${{ steps.extract_tag.outputs.tag }}
context: ./malcolm-iso
push: true
tags: ${{ env.IMAGE_NAME }}:vosk-${{ steps.extract_tag.outputs.tag }}
context: ${{ env.REPO_CONTEXT }}
containerfiles: ${{ env.REPO_CONTAINERFILE }}
archs: ${{ env.IMAGE_ARCH }}
file: ${{ env.REPO_CONTAINERFILE }}
platforms: ${{ env.IMAGE_ARCH }}
target: vosk
build-args: |
VOSK_MODEL_URL=${{ steps.extract_url.outputs.url }}
-
name: Run Trivy vulnerability scanner (VOSK)
id: trivy-scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'image'
image-ref: ${{ steps.build-vosk-image.outputs.image }}:${{ steps.build-vosk-image.outputs.tags }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'HIGH,CRITICAL'
vuln-type: 'os,library'
hide-progress: true
ignore-unfixed: true
exit-code: '0'
-
name: Upload Trivy scan results to GitHub Security tab (VOSK)
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
-
name: Push (VOSK)
id: push-vosk-image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-vosk-image.outputs.image }}
tags: ${{ steps.build-vosk-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
66 changes: 23 additions & 43 deletions .github/workflows/monkeyplug-build-push-whisper-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ jobs:
-
name: Set up QEMU
id: setup-qemu
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
-
name: Log in to registry
id: registry-login
uses: redhat-actions/podman-login@v1
name: Set up Docker Buildx
id: setup-docker-buildx
uses: docker/setup-buildx-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
driver-opts: |
image=moby/buildkit:master
-
name: Free up space
shell: bash
Expand All @@ -83,43 +82,24 @@ jobs:
/usr/local/share/boost \
"$AGENT_TOOLSDIRECTORY" || true
-
name: Build (Whisper)
id: build-whisper-image
uses: redhat-actions/buildah-build@v2
name: ghcr.io login
id: ghcr-io-login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push Monkeyplug (Whisper) image
id: build-and-push
uses: docker/build-push-action@v5
with:
image: ${{ env.IMAGE_NAME }}
tags: whisper-${{ matrix.value }}
context: ./malcolm-iso
push: true
tags: ${{ env.IMAGE_NAME }}:whisper-${{ matrix.value }}
context: ${{ env.REPO_CONTEXT }}
containerfiles: ${{ env.REPO_CONTAINERFILE }}
archs: ${{ env.IMAGE_ARCH }}
file: ${{ env.REPO_CONTAINERFILE }}
platforms: ${{ env.IMAGE_ARCH }}
target: whisper
build-args: |
WHISPER_MODEL_NAME=${{ matrix.value }}
-
name: Run Trivy vulnerability scanner (Whisper)
id: trivy-scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'image'
image-ref: ${{ steps.build-whisper-image.outputs.image }}:${{ steps.build-whisper-image.outputs.tags }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'HIGH,CRITICAL'
vuln-type: 'os,library'
hide-progress: true
ignore-unfixed: true
exit-code: '0'
-
name: Upload Trivy scan results to GitHub Security tab (Whisper)
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'
-
name: Push (Whisper)
id: push-whisper-image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-whisper-image.outputs.image }}
tags: ${{ steps.build-whisper-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
WHISPER_MODEL_NAME=${{ matrix.value }}
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ RUN python3 -m pip install --no-cache openai-whisper && \
cd "$WHISPER_MODEL_DIR" && \
echo "Downloading Whisper model \"$WHISPER_MODEL_NAME\"..." && \
curl -fsSL -o ./"$WHISPER_MODEL_NAME" "$(curl -fsSL https://raw.githubusercontent.com/openai/whisper/main/whisper/__init__.py | grep -P "\"$WHISPER_MODEL_NAME\"\s*:\s*\"https://" | cut -d: -f2- | sed 's/^[[:space:]]*"//' | sed 's/",*$//')" && \
echo "Finished"
echo "Finished"

0 comments on commit ef4234b

Please sign in to comment.