Skip to content

Commit 1a7edd4

Browse files
committed
cpu and gpu
1 parent 60f9a14 commit 1a7edd4

File tree

3 files changed

+57
-10
lines changed

3 files changed

+57
-10
lines changed

.github/workflows/cleanup-ghcr.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: "Prune old GHCR images"
2+
3+
on:
4+
# 1) Run daily at 02:00 UTC
5+
schedule:
6+
- cron: '0 2 * * *'
7+
# 2) Also run on every push to main (or your default branch)
8+
push:
9+
branches:
10+
- docker
11+
12+
permissions:
13+
contents: read # for listing versions
14+
packages: write # for deleting package versions
15+
16+
jobs:
17+
prune:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Install jq and GitHub CLI
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y jq
25+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
26+
| sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
27+
echo \
28+
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] \
29+
https://cli.github.com/packages stable main" \
30+
| sudo tee /etc/apt/sources.list.d/github-cli.list
31+
sudo apt-get update
32+
sudo apt-get install -y gh
33+
34+
- name: Authenticate gh
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
run: |
38+
echo "$GITHUB_TOKEN" | gh auth login --with-token
39+
40+
- name: Delete non-latest versions
41+
env:
42+
OWNER: ${{ github.repository_owner }}
43+
IMAGE: deep-learning-crash-course
44+
run: |
45+
gh api -H "Accept: application/vnd.github.v3+json" \
46+
/users/$OWNER/packages/container/$IMAGE/versions \
47+
| jq -c '.[]' \
48+
| while read version; do
49+
id=$(echo "$version" | jq -r '.id')
50+
tags=$(echo "$version" | jq -r '.metadata.container.tags[]')
51+
if [[ ! " $tags " =~ " latest " ]]; then
52+
echo "Deleting version $id (tags: $tags)"
53+
gh api -X DELETE \
54+
-H "Accept: application/vnd.github.v3+json" \
55+
/users/$OWNER/packages/container/$IMAGE/versions/$id
56+
fi
57+
done

docker/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,5 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt
3636
# Enable Jupyter widget support
3737
RUN pip install --no-cache-dir ipywidgets
3838

39-
# For JupyterLab (inside the container), install the widget manager
40-
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager \
41-
--no-build && \
42-
jupyter lab build
43-
4439
EXPOSE 8888
4540
CMD ["start-notebook.sh"]

docker/Dockerfile.gpu

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,5 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt
3232
# Enable Jupyter widget support
3333
RUN pip install --no-cache-dir ipywidgets
3434

35-
# For JupyterLab (inside the container), install the widget manager
36-
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager \
37-
--no-build && \
38-
jupyter lab build
39-
4035
EXPOSE 8888
4136
CMD ["start-notebook.sh"]

0 commit comments

Comments
 (0)