Skip to content
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
30 changes: 15 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// For format details, see https://aka.ms/devcontainer.json.
{
"name": "labs344",
"context": "..",
"dockerFile": "../containers/labs344/Dockerfile",
"customizations": {
"vscode": {
"settings": {},
"extensions": []
}
},
"initializeCommand": "xhost +local:",
"name": "Labs344",
"image": "ghcr.io/bouncmpe/labs344:latest-devel",
"containerEnv": {
"DISPLAY": "${localEnv:DISPLAY}"
"DISPLAY": "${localEnv:DISPLAY}",
"XAUTHORITY": "/tmp/.Xauthority"
},
"runArgs": [
"--env=DISPLAY",
"--mount=type=bind,source=/tmp/.X11-unix,target=/tmp/.X11-unix,consistency=cached"
// "--device=/dev/dri", // Enable GPU acceleration
"--network=host",
"--security-opt=label:type:container_runtime_t"
],
"remoteUser": "bouncmpe"
"mounts": [
"source=${localEnv:XAUTHORITY},target=/tmp/.Xauthority,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"extensions": []
}
}
}
138 changes: 0 additions & 138 deletions .github/workflows/buildah-build-tools.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
name: Container Build (Toolchain)
name: Container Release
on:
push:
paths:
- containers/labs344/**
- .github/workflows/container-release.yml # Self-trigger
workflow_dispatch:
inputs:
publish:
description: "Publish to the registry"
required: true
default: true
description: "Publish to the container registry"
required: false
default: false
type: boolean

env:
REGISTRY: ghcr.io/bouncmpe
REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE_NAME: labs344
LABS344_VERSION: latest
HOSTARCH: amd64
PLATFORM: linux-amd64
CONTAINER_VERSION: latest
CONTAINER_LATEST_VERSION: latest
CONTAINERS_ROOT: /home/runner/.local/share/containers
TMPDIR: /home/runner/.local/share/containers/tmp

Expand All @@ -21,6 +28,7 @@ permissions:

jobs:
buildah-build:
name: Build container images
strategy:
fail-fast: false
matrix:
Expand All @@ -29,7 +37,7 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}
cancel-in-progress: true

steps:
- name: Install container tools
run: sudo apt-get install podman buildah jq
Expand All @@ -44,17 +52,17 @@ jobs:
remove-codeql: "true"
remove-docker-images: "true"
build-mount-path: ${{ env.CONTAINERS_ROOT }} # The remaining space only for container build

- run: mkdir -p $TMPDIR

- name: Checkout repository
uses: actions/checkout@v4

- name: Prepare environment variables
run: |
echo "HOSTARCH=$(podman info --format='{{.Host.Arch}}')" >> $GITHUB_ENV
echo "PLATFORM=$(podman info --format='{{.Version.OsArch}}' | sed 's/\//-/g')" >> $GITHUB_ENV
echo "LABS344_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "CONTAINER_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the GitHub Container registry
uses: redhat-actions/podman-login@v1
Expand All @@ -63,39 +71,38 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build toolchain container image
id: build-toolchain
- name: Build runtime container image
id: build-runtime
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: |
${{ env.LABS344_VERSION }}-toolchain
${{ env.LABS344_VERSION }}-toolchain-${{ env.HOSTARCH }}
context: .
image: labs344
tags: ${{ env.CONTAINER_VERSION }}-runtime ${{ env.CONTAINER_VERSION }}-runtime-${{ env.HOSTARCH }}
layers: true
oci: true
build-args: |
LABS344_VERSION=${{ env.LABS344_VERSION }}
CONTAINER_VERSION=${{ env.CONTAINER_VERSION }}
CONTAINER_IMAGE_REGISTRY_REMOTE=${{ env.REGISTRY }}
extra-args: |
--target labs344-toolchain
--target labs344-runtime
containerfiles: |
containers/labs344/Dockerfile
context: containers
./containers/labs344/Dockerfile

- name: Push to GitHub Container Repository
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && github.event.inputs.publish
id: push-toolchain-ghcr
if: github.event_name == 'workflow_dispatch' && github.event.inputs.publish
id: push-runtime-ghcr
uses: redhat-actions/push-to-registry@v2
with:
registry: ${{ env.REGISTRY }}
image: ${{ steps.build-toolchain.outputs.image }}
tags: ${{ env.LABS344_VERSION }}-toolchain-${{ env.HOSTARCH }}
digestfile: ${{ runner.temp }}/digest-labs344-toolchain-${{ env.LABS344_VERSION }}-${{ env.PLATFORM }}
image: ${{ steps.build-runtime.outputs.image }}
tags: ${{ env.CONTAINER_VERSION }}-runtime-${{ env.HOSTARCH }}
digestfile: ${{ runner.temp }}/digest-labs344-runtime-${{ env.CONTAINER_VERSION }}-${{ env.PLATFORM }}

- name: Upload digests
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && github.event.inputs.publish
if: github.event_name == 'workflow_dispatch' && github.event.inputs.publish
uses: actions/upload-artifact@v4
with:
name: digest-bouncmpe-${{ env.LABS344_VERSION }}-${{ env.PLATFORM }}
name: digest-labs344-${{ env.CONTAINER_VERSION }}-${{ env.PLATFORM }}
path: ${{ runner.temp }}/digest-*
if-no-files-found: error
retention-days: 1
Expand All @@ -105,7 +112,7 @@ jobs:
name: Merge container images
runs-on: ubuntu-24.04
needs: buildah-build
if: always() && github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' && github.event.inputs.publish
if: always() && github.event_name == 'workflow_dispatch' && github.event.inputs.publish
steps:
- name: Download digests
uses: actions/download-artifact@v4
Expand All @@ -114,25 +121,31 @@ jobs:
pattern: digest-*
merge-multiple: true

- name: Prepare environment variables
run: |
echo "LABS344_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV

- name: Log in to the GitHub Container registry
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create and push manifest list for labs344-toolchain
- name: Prepare environment variables
run: |
if [ "${{ env.CONTAINER_VERSION }}" == "latest" ]; then
echo "CONTAINER_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV
fi
echo "CONTAINER_LATEST_VERSION=$(date +'%Y%m%d')" >> $GITHUB_ENV

- name: Create and push manifest list for labs344-runtime
run: |
MANIFEST=labs344-toolchain
MANIFEST=labs344-runtime
FULL_IMAGE_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
buildah manifest create $MANIFEST
for digest in ${{ runner.temp }}/digests/digest-labs344-toolchain-*; do
for digest in ${{ runner.temp }}/digests/digest-labs344-runtime-*; do
echo "Adding $(cat $digest)"
buildah manifest add $MANIFEST $FULL_IMAGE_NAME@$(cat $digest)
done
buildah manifest push --all $MANIFEST docker://$FULL_IMAGE_NAME:${{ env.LABS344_VERSION }}-toolchain
buildah manifest push --all $MANIFEST docker://$FULL_IMAGE_NAME:latest-toolchain
buildah manifest push --all $MANIFEST docker://$FULL_IMAGE_NAME:${{ env.CONTAINER_VERSION }}-runtime
if [ "${{ env.CONTAINER_VERSION }}" == "${{ env.CONTAINER_LATEST_VERSION }}" ]; then
buildah manifest push --all $MANIFEST docker://$FULL_IMAGE_NAME:latest
buildah manifest push --all $MANIFEST docker://$FULL_IMAGE_NAME:latest-runtime
fi
25 changes: 12 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@

# Ignore the following files
*.vcd
*.log
*.hex
*.dis
*.tbl
*.map
snapshots
veer*
verilator*
*.elf
*.exe
obj*
*.o
*.sym
*.log
*.hex
*.dis
*.objdump
*.tbl
*.map
snapshots
*.elf
*.exe
obj*
*.o
*.sym
Loading