Skip to content

Commit

Permalink
Update build scripts for Selkies v1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
robballantyne committed Aug 8, 2024
1 parent f1142ba commit 5289e0d
Show file tree
Hide file tree
Showing 52 changed files with 588 additions and 203 deletions.
112 changes: 86 additions & 26 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Docker Build

on:
workflow_dispatch:
push:
branches: [ "main" ]
#push:
# branches: [ "main" ]

env:
UBUNTU_VERSION: 22.04
Expand All @@ -30,34 +30,54 @@ jobs:
-
name: Env Setter
run: |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
REPO=${GITHUB_REPOSITORY,,}
echo "REPO_NAMESPACE=${REPO%%/*}" >> ${GITHUB_ENV}
echo "REPO_NAME=${REPO#*/}" >> ${GITHUB_ENV}
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
target="${HOME}/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set tags
run: |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}"
ver_tag="v2-cpu-${{ env.UBUNTU_VERSION }}"
img_path_ghcr="ghcr.io/${{ env.REPO_NAMESPACE }}/${{ env.REPO_NAME }}"
img_path_dhub="${{ vars.DOCKERHUB_USER }}/${{ env.REPO_NAME }}-cpu"
if [[ -z ${{ matrix.build.selkies }} || ${{ matrix.build.selkies }} == "latest" ]]; then
SELKIES_VERSION="$(curl -fsSL "https://api.github.com/repos/selkies-project/selkies-gstreamer/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')"
else
SELKIES_VERSION=${{ matrix.build.selkies }}
fi
[[ -n $SELKIES_VERSION ]] || { echo "Error: SELKIES_VERSION is empty. Exiting script." >&2; exit 1; }
echo "SELKIES_VERSION=${SELKIES_VERSION}" >> ${GITHUB_ENV}
base_tag="v2-cpu-${{ env.UBUNTU_VERSION }}"
if [[ ${{ matrix.build.latest }} == "true" ]]; then
echo "Marking latest"
TAGS="${img_path}:${base_tag}, ${img_path}:latest-cpu"
# GHCR.io Tags
TAGS="${img_path_ghcr}:${base_tag}, ${img_path_ghcr}:latest-cpu"
# Docker.io Tags
TAGS="${TAGS}, ${img_path_dhub}:${SELKIES_VERSION}-ubuntu-${{ env.UBUNTU_VERSION }}, ${img_path_dhub}:latest"
else
TAGS="${img_path}:${base_tag}"
TAGS="${img_path_ghcr}:${base_tag}, ${img_path_dhub}:${SELKIES_VERSION}-ubuntu-${{ env.UBUNTU_VERSION }}"
fi
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
-
Expand Down Expand Up @@ -92,34 +112,54 @@ jobs:
-
name: Env Setter
run: |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
REPO=${GITHUB_REPOSITORY,,}
echo "REPO_NAMESPACE=${REPO%%/*}" >> ${GITHUB_ENV}
echo "REPO_NAME=${REPO#*/}" >> ${GITHUB_ENV}
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
target="${HOME}/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set tags
run: |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}"
ver_tag="v2-cuda-${{ matrix.build.cuda }}-${{ env.UBUNTU_VERSION }}"
img_path_ghcr="ghcr.io/${{ env.REPO_NAMESPACE }}/${{ env.REPO_NAME }}"
img_path_dhub="${{ vars.DOCKERHUB_USER }}/${{ env.REPO_NAME }}-cuda"
if [[ -z ${{ matrix.build.selkies }} || ${{ matrix.build.selkies }} == "latest" ]]; then
SELKIES_VERSION="$(curl -fsSL "https://api.github.com/repos/selkies-project/selkies-gstreamer/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')"
else
SELKIES_VERSION=${{ matrix.build.selkies }}
fi
[[ -n $SELKIES_VERSION ]] || { echo "Error: SELKIES_VERSION is empty. Exiting script." >&2; exit 1; }
echo "SELKIES_VERSION=${SELKIES_VERSION}" >> ${GITHUB_ENV}
base_tag="v2-cuda-${{ matrix.build.cuda }}-${{ env.UBUNTU_VERSION }}"
if [[ ${{ matrix.build.latest }} == "true" ]]; then
echo "Marking latest"
TAGS="${img_path}:${base_tag}, ${img_path}:latest, ${img_path}:latest-cuda"
# GHCR.io Tags
TAGS="${img_path_ghcr}:${base_tag}, ${img_path_ghcr}:${base_tag}-${SELKIES_VERSION}, ${img_path_ghcr}:latest, ${img_path_ghcr}:latest-cuda"
# Docker.io Tags
TAGS="${TAGS}, ${img_path_dhub}:${SELKIES_VERSION}-${{ matrix.build.cuda }}, ${img_path_dhub}:latest"
else
TAGS="${img_path}:${base_tag}"
TAGS="${img_path_ghcr}:${base_tag}-${SELKIES_VERSION}, ${img_path_dhub}:${SELKIES_VERSION}-${{ matrix.build.cuda }}
fi
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
-
Expand Down Expand Up @@ -153,34 +193,54 @@ jobs:
-
name: Env Setter
run: |
echo "PACKAGE_NAME=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV}
REPO=${GITHUB_REPOSITORY,,}
echo "REPO_NAMESPACE=${REPO%%/*}" >> ${GITHUB_ENV}
echo "REPO_NAME=${REPO#*/}" >> ${GITHUB_ENV}
-
name: Checkout
uses: actions/checkout@v3
-
name: Permissions fixes
run: |
reponame="$(basename ${GITHUB_REPOSITORY})"
target="${HOME}/work/${reponame}/${reponame}/build/COPY*"
target="${HOME}/work/${{ env.REPO_NAME }}/${{ env.REPO_NAME }}/build/COPY*"
chmod -R ug+rwX ${target}
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Set tags
run: |
img_path="ghcr.io/${{ env.PACKAGE_NAME }}"
ver_tag="v2-rocm-${{ matrix.build.rocm }}-${{ env.UBUNTU_VERSION }}"
img_path_ghcr="ghcr.io/${{ env.REPO_NAMESPACE }}/${{ env.REPO_NAME }}"
img_path_dhub="${{ vars.DOCKERHUB_USER }}/${{ env.REPO_NAME }}-rocm"
if [[ -z ${{ matrix.build.selkies }} || ${{ matrix.build.selkies }} == "latest" ]]; then
SELKIES_VERSION="$(curl -fsSL "https://api.github.com/repos/selkies-project/selkies-gstreamer/releases/latest" | jq -r '.tag_name' | sed 's/[^0-9\.\-]*//g')"
else
SELKIES_VERSION=${{ matrix.build.selkies }}
fi
[[ -n $SELKIES_VERSION ]] || { echo "Error: SELKIES_VERSION is empty. Exiting script." >&2; exit 1; }
echo "SELKIES_VERSION=${SELKIES_VERSION}" >> ${GITHUB_ENV}
base_tag="v2-cuda-${{ matrix.build.rocm }}-${{ env.UBUNTU_VERSION }}"
if [[ ${{ matrix.build.latest }} == "true" ]]; then
echo "Marking latest"
TAGS="${img_path}:${base_tag}, ${img_path}:latest-rocm"
# GHCR.io Tags
TAGS="${img_path_ghcr}:${base_tag}, ${img_path_ghcr}:${base_tag}-${SELKIES_VERSION}, ${img_path_ghcr}:latest-rocm"
# Docker.io Tags
TAGS="${TAGS}, ${img_path_dhub}:${SELKIES_VERSION}-${{ matrix.build.rocm }}, ${img_path_dhub}:latest"
else
TAGS="${img_path}:${base_tag}"
TAGS="${img_path_ghcr}:${base_tag}-${SELKIES_VERSION}, ${img_path_dhub}:${SELKIES_VERSION}-${{ matrix.build.rocm }}
fi
echo "TAGS=${TAGS}" >> ${GITHUB_ENV}
-
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

# Linux Desktop

Run a hardware accelerated KDE desktop in a container. This image is heavily influenced by [Selkies Project](https://github.com/selkies-project) to provide an accelerated desktop environment for NVIDIA, AMD and Intel machines.
Run a hardware accelerated KDE desktop in a container. This image is heavily influenced by [Selkies Project](https://github.com/selkies-project) to provide an accelerated desktop environment for NVIDIA, AMD and Intel machines.

Please see this [important notice](#selkies-notice) from the Selkies development team.


## Documentation
Expand All @@ -21,12 +23,12 @@ Tags follow these patterns:
##### _CUDA_
- `:cuda-[x.x.x]{-cudnn[x]}-[base|runtime|devel]-[ubuntu-version]`

- `:latest-cuda` → `:cuda-11.8.0-runtime-22.04`
- `:latest-cuda` → `:cuda-12.1.1-cudnn8-runtime-22.04`

##### _ROCm_
- `:rocm-[x.x.x]-[core|runtime|devel]-[ubuntu-version]`

- `:latest-rocm` → `:rocm-5.6-runtime-22.04`
- `:latest-rocm` → `:rocm-6.0-runtime-22.04`

ROCm builds are experimental. Please give feedback.

Expand All @@ -35,7 +37,7 @@ ROCm builds are experimental. Please give feedback.

- `:latest-cpu` → `:cpu-22.04`

Browse [here](https://github.com/ai-dock/linux-desktop/pkgs/container/linux-desktop) for an image suitable for your target environment.
Browse [here](https://github.com/ai-dock/linux-desktop/pkgs/container/linux-desktop) for an image suitable for your target environment.

Supported Desktop Environments: `KDE Plasma`

Expand All @@ -49,6 +51,12 @@ Supported Platforms: `NVIDIA CUDA`, `AMD ROCm`, `CPU/iGPU`
[linux-desktop:latest](https://link.ai-dock.org/template-vast-linux-desktop)


---

## Selkies Notice

This project has been developed and is supported in part by the National Research Platform (NRP) and the Cognitive Hardware and Software Ecosystem Community Infrastructure (CHASE-CI) at the University of California, San Diego, by funding from the National Science Foundation (NSF), with awards #1730158, #1540112, #1541349, #1826967, #2138811, #2112167, #2100237, and #2120019, as well as additional funding from community partners, infrastructure utilization from the Open Science Grid Consortium, supported by the National Science Foundation (NSF) awards #1836650 and #2030508, and infrastructure utilization from the Chameleon testbed, supported by the National Science Foundation (NSF) awards #1419152, #1743354, and #2027170. This project has also been funded by the Seok-San Yonsei Medical Scientist Training Program (MSTP) Song Yong-Sang Scholarship, College of Medicine, Yonsei University, the MD-PhD/Medical Scientist Training Program (MSTP) through the Korea Health Industry Development Institute (KHIDI), funded by the Ministry of Health & Welfare, Republic of Korea, and the Student Research Bursary of Song-dang Institute for Cancer Research, College of Medicine, Yonsei University.

---

_The author ([@robballantyne](https://github.com/robballantyne)) may be compensated if you sign up to services linked in this document. Testing multiple variants of GPU images in many different environments is both costly and time-consuming; This helps to offset costs_
15 changes: 0 additions & 15 deletions build/COPY_ROOT/opt/ai-dock/bin/preflight.d/20-desktop.sh

This file was deleted.

1 change: 1 addition & 0 deletions build/COPY_ROOT_0/SELKIES-PROJECT_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This project has been developed and is supported in part by the National Research Platform (NRP) and the Cognitive Hardware and Software Ecosystem Community Infrastructure (CHASE-CI) at the University of California, San Diego, by funding from the National Science Foundation (NSF), with awards #1730158, #1540112, #1541349, #1826967, #2138811, #2112167, #2100237, and #2120019, as well as additional funding from community partners, infrastructure utilization from the Open Science Grid Consortium, supported by the National Science Foundation (NSF) awards #1836650 and #2030508, and infrastructure utilization from the Chameleon testbed, supported by the National Science Foundation (NSF) awards #1419152, #1743354, and #2027170. This project has also been funded by the Seok-San Yonsei Medical Scientist Training Program (MSTP) Song Yong-Sang Scholarship, College of Medicine, Yonsei University, the MD-PhD/Medical Scientist Training Program (MSTP) through the Korea Health Industry Development Institute (KHIDI), funded by the Ministry of Health & Welfare, Republic of Korea, and the Student Research Bursary of Song-dang Institute for Cancer Research, College of Medicine, Yonsei University.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[program:dbus]
user=$USER_NAME
environment=PROC_NAME="%(program_name)s",USER=$USER_NAME,HOME=/home/$USER_NAME
command=supervisor-dbus.sh
process_name=%(program_name)s
numprocs=1
directory=/root
directory=/home/$USER_NAME
priority=10
autostart=true
startsecs=5
Expand All @@ -16,4 +18,4 @@ stdout_logfile=/var/log/supervisor/dbus.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=1
redirect_stderr=true
environment=PROC_NAME="%(program_name)s"

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[program:pipewire-pulse]
user=$USER_NAME
environment=PROC_NAME="%(program_name)s",USER=$USER_NAME,HOME=/home/$USER_NAME
command=supervisor-pipewire-pulse.sh
process_name=%(program_name)s
numprocs=1
directory=/home/$USER_NAME
priority=10
autostart=true
startsecs=5
startretries=3
autorestart=unexpected
stopsignal=TERM
stopwaitsecs=10
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/pipewire-pulse.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=1
redirect_stderr=true
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[program:pulseaudio]
command=supervisor-pulseaudio.sh
[program:pipewire]
user=$USER_NAME
environment=PROC_NAME="%(program_name)s",USER=$USER_NAME,HOME=/home/$USER_NAME
command=supervisor-pipewire.sh
process_name=%(program_name)s
numprocs=1
directory=/root
directory=/home/$USER_NAME
priority=10
autostart=true
startsecs=5
Expand All @@ -12,8 +14,8 @@ stopsignal=TERM
stopwaitsecs=10
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/pulseaudio.log
stdout_logfile=/var/log/supervisor/pipewire.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=1
redirect_stderr=true
environment=PROC_NAME="%(program_name)s"

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[program:wireplumber]
user=$USER_NAME
environment=PROC_NAME="%(program_name)s",USER=$USER_NAME,HOME=/home/$USER_NAME
command=supervisor-wireplumber.sh
process_name=%(program_name)s
numprocs=1
directory=/home/$USER_NAME
priority=10
autostart=true
startsecs=5
startretries=3
autorestart=unexpected
stopsignal=TERM
stopwaitsecs=10
stopasgroup=true
killasgroup=true
stdout_logfile=/var/log/supervisor/wireplumber.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=1
redirect_stderr=true

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# Tidy up and keep image small
apt-get clean -y
micromamba clean -ay

fix-permissions.sh -o container

Expand Down
Loading

0 comments on commit 5289e0d

Please sign in to comment.