Skip to content

Commit 88b00f5

Browse files
committed
Merge branch 'develop' of https://github.com/AMDResearch/aup-learning-cloud into develop
2 parents 742c7d4 + 5f0c0dc commit 88b00f5

22 files changed

Lines changed: 1034 additions & 893 deletions

.github/workflows/docker-build.yml

Lines changed: 79 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,17 @@ jobs:
194194
- name: Checkout code
195195
uses: actions/checkout@v4
196196

197+
- name: Free disk space
198+
uses: jlumbroso/free-disk-space@main
199+
with:
200+
tool-cache: true
201+
android: true
202+
dotnet: true
203+
haskell: true
204+
large-packages: true
205+
docker-images: true
206+
swap-storage: false
207+
197208
- name: Set up Docker Buildx
198209
uses: docker/setup-buildx-action@v3
199210

@@ -203,7 +214,7 @@ jobs:
203214
with:
204215
registry: ghcr.io
205216
username: ${{ github.actor }}
206-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
217+
password: ${{ secrets.GITHUB_TOKEN }}
207218

208219
- name: Docker metadata
209220
id: meta
@@ -260,6 +271,17 @@ jobs:
260271
- name: Checkout code
261272
uses: actions/checkout@v4
262273

274+
- name: Free disk space
275+
uses: jlumbroso/free-disk-space@main
276+
with:
277+
tool-cache: true
278+
android: true
279+
dotnet: true
280+
haskell: true
281+
large-packages: true
282+
docker-images: true
283+
swap-storage: false
284+
263285
- name: Set up Node.js
264286
uses: actions/setup-node@v4
265287
with:
@@ -274,6 +296,13 @@ jobs:
274296
npm --prefix dockerfiles/Code/auplc-hub-link run package
275297
test -f dockerfiles/Code/auplc-hub-link/auplc-hub-link-0.0.0.vsix
276298
299+
- name: Clean Hub link build artifacts
300+
if: always()
301+
run: |
302+
rm -rf dockerfiles/Code/auplc-hub-link/node_modules
303+
rm -rf dockerfiles/Code/auplc-hub-link/out
304+
npm cache clean --force
305+
277306
- name: Set up Docker Buildx
278307
uses: docker/setup-buildx-action@v3
279308

@@ -283,7 +312,7 @@ jobs:
283312
with:
284313
registry: ghcr.io
285314
username: ${{ github.actor }}
286-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
315+
password: ${{ secrets.GITHUB_TOKEN }}
287316

288317
- name: Docker metadata
289318
id: meta
@@ -329,6 +358,17 @@ jobs:
329358
- name: Checkout code
330359
uses: actions/checkout@v4
331360

361+
- name: Free disk space
362+
uses: jlumbroso/free-disk-space@main
363+
with:
364+
tool-cache: true
365+
android: true
366+
dotnet: true
367+
haskell: true
368+
large-packages: true
369+
docker-images: true
370+
swap-storage: false
371+
332372
- name: Set up Docker Buildx
333373
uses: docker/setup-buildx-action@v3
334374

@@ -338,7 +378,7 @@ jobs:
338378
with:
339379
registry: ghcr.io
340380
username: ${{ github.actor }}
341-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
381+
password: ${{ secrets.GITHUB_TOKEN }}
342382

343383
- name: Docker metadata
344384
id: meta
@@ -397,6 +437,17 @@ jobs:
397437
- name: Checkout code
398438
uses: actions/checkout@v4
399439

440+
- name: Free disk space
441+
uses: jlumbroso/free-disk-space@main
442+
with:
443+
tool-cache: true
444+
android: true
445+
dotnet: true
446+
haskell: true
447+
large-packages: true
448+
docker-images: true
449+
swap-storage: false
450+
400451
- name: Set up Node.js
401452
uses: actions/setup-node@v4
402453
with:
@@ -411,6 +462,13 @@ jobs:
411462
npm --prefix dockerfiles/Code/auplc-hub-link run package
412463
test -f dockerfiles/Code/auplc-hub-link/auplc-hub-link-0.0.0.vsix
413464
465+
- name: Clean Hub link build artifacts
466+
if: always()
467+
run: |
468+
rm -rf dockerfiles/Code/auplc-hub-link/node_modules
469+
rm -rf dockerfiles/Code/auplc-hub-link/out
470+
npm cache clean --force
471+
414472
- name: Set up Docker Buildx
415473
uses: docker/setup-buildx-action@v3
416474

@@ -420,7 +478,7 @@ jobs:
420478
with:
421479
registry: ghcr.io
422480
username: ${{ github.actor }}
423-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
481+
password: ${{ secrets.GITHUB_TOKEN }}
424482

425483
- name: Docker metadata (target-suffixed tags)
426484
id: meta-suffixed
@@ -532,7 +590,7 @@ jobs:
532590
with:
533591
registry: ghcr.io
534592
username: ${{ github.actor }}
535-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
593+
password: ${{ secrets.GITHUB_TOKEN }}
536594

537595
- name: Resolve GPU config
538596
id: suffix
@@ -650,6 +708,17 @@ jobs:
650708
- name: Checkout code
651709
uses: actions/checkout@v4
652710

711+
- name: Free disk space
712+
uses: jlumbroso/free-disk-space@main
713+
with:
714+
tool-cache: true
715+
android: true
716+
dotnet: true
717+
haskell: true
718+
large-packages: true
719+
docker-images: true
720+
swap-storage: false
721+
653722
- name: Set up Docker Buildx
654723
uses: docker/setup-buildx-action@v3
655724

@@ -658,7 +727,7 @@ jobs:
658727
with:
659728
registry: ghcr.io
660729
username: ${{ github.actor }}
661-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
730+
password: ${{ secrets.GITHUB_TOKEN }}
662731

663732
- name: Prepare build context
664733
run: cp -r projects/${{ matrix.course }} dockerfiles/Courses/${{ matrix.course }}/course_data
@@ -753,3 +822,7 @@ jobs:
753822
cache-from: type=gha,scope=course-${{ matrix.course }}-${{ matrix.gpu_target }}
754823
cache-to: type=gha,mode=max,scope=course-${{ matrix.course }}-${{ matrix.gpu_target }}
755824
provenance: false
825+
826+
- name: Clean course build context
827+
if: always()
828+
run: rm -rf dockerfiles/Courses/${{ matrix.course }}/course_data

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
python-version: '3.10'
3535

3636
- name: Install test deps
37-
run: pip install pyyaml
37+
run: pip install pytest pyyaml
3838

3939
- name: Run installer unit tests
40-
run: python -m unittest discover tests/installer -v
40+
run: python -m pytest tests/installer -v
4141

4242
frontend-lint:
4343
name: Frontend (ESLint + TypeScript)

.github/workflows/pack-bundle.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
with:
9393
registry: ghcr.io
9494
username: ${{ github.actor }}
95-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
95+
password: ${{ secrets.GITHUB_TOKEN }}
9696

9797
- name: Resolve image tag and registry
9898
id: tag
@@ -195,7 +195,7 @@ jobs:
195195
with:
196196
registry: ghcr.io
197197
username: ${{ github.actor }}
198-
password: ${{ secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
198+
password: ${{ secrets.GITHUB_TOKEN }}
199199

200200
- name: Resolve image tag
201201
id: tag
@@ -225,4 +225,3 @@ jobs:
225225
path: auplc-bundle-*.tar.gz
226226
retention-days: 7
227227
compression-level: 0 # already compressed
228-

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,8 @@ vite.config.ts.timestamp-*
389389
dockerfiles/Courses/DL/data/FashionMNIST/raw/
390390
*.vsix
391391

392-
# Local config overrides (any file containing 'local')
393-
*local*
394-
*.local.*
392+
# Local config overrides
393+
runtime/values.local.yaml
395394

396395
# Offline bundle artifacts
397396
auplc-bundle-*/

deploy/ansible/playbooks/pb-pxe-controller.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@
6363
# - "ssh-ed25519 AAAA... you@workstation"
6464
# - "ssh-rsa AAAA... ci@runner"
6565

66+
# Apache HTTP port for serving the k3s token / kubeconfig to PXE agents.
67+
# Defaults to 8080 (not 80) so the PXE controller can live on a k3s node
68+
# without clashing with k3s Traefik / ServiceLB, which owns host port 80/443.
69+
pxe_web_port: 8080
70+
6671
# APT Mirror
6772
pxe_apt_mirror: "http://tw.archive.ubuntu.com/ubuntu"
6873

deploy/ansible/roles/pxe_controller/defaults/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ pxe_nfs_root: "/srv/nfs/rootfs"
9393
pxe_tftp_root: "/srv/tftp"
9494
pxe_web_root: "/var/www/html"
9595

96+
# TCP port Apache listens on to serve the k3s token / kubeconfig to PXE agents.
97+
# This is an internal-only endpoint (reachable from the node subnet), so the port
98+
# number is arbitrary. It defaults to 8080 -- NOT 80 -- so the PXE controller can
99+
# be co-located on a k3s node without colliding with k3s Traefik / ServiceLB,
100+
# which binds host port 80 (and 443) for cluster ingress.
101+
pxe_web_port: 8080
102+
96103
# ============================================================
97104
# Rootfs build settings
98105
# ============================================================

deploy/ansible/roles/pxe_controller/tasks/main.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,46 @@
431431
changed_when: "'Enabling' in _a2enconf.stdout"
432432
notify: Restart apache2
433433

434+
# Apache serves the token/kubeconfig on pxe_web_port (default 8080) instead of
435+
# 80 so the PXE controller can be co-located on a k3s node without colliding with
436+
# k3s Traefik / ServiceLB, which owns host port 80/443.
437+
- name: Configure Apache listen port
438+
ansible.builtin.template:
439+
src: apache-ports.conf.j2
440+
dest: /etc/apache2/ports.conf
441+
mode: "0644"
442+
notify: Restart apache2
443+
444+
- name: Deploy PXE HTTP virtual host
445+
ansible.builtin.template:
446+
src: pxe-http-vhost.conf.j2
447+
dest: /etc/apache2/sites-available/pxe-http.conf
448+
mode: "0644"
449+
notify: Restart apache2
450+
451+
- name: Enable PXE HTTP virtual host
452+
ansible.builtin.command:
453+
cmd: a2ensite pxe-http
454+
register: _a2ensite
455+
changed_when: "'Enabling' in _a2ensite.stdout"
456+
notify: Restart apache2
457+
458+
- name: Disable default Apache site (frees host port 80)
459+
ansible.builtin.command:
460+
cmd: a2dissite 000-default
461+
register: _a2dissite
462+
changed_when: "'Disabling' in _a2dissite.stdout"
463+
notify: Restart apache2
464+
434465
- name: Enable and start Apache
435466
ansible.builtin.systemd:
436467
name: apache2
437468
state: started
438469
enabled: true
439470

471+
- name: Flush handlers for Apache
472+
ansible.builtin.meta: flush_handlers
473+
440474
# ==========================================================
441475
# 12. Verify PXE server status
442476
# ==========================================================
@@ -491,7 +525,7 @@
491525

492526
- name: Check HTTP token endpoint is reachable
493527
ansible.builtin.uri:
494-
url: "http://127.0.0.1/k3s/"
528+
url: "http://127.0.0.1:{{ pxe_web_port }}/k3s/"
495529
status_code: [200, 403]
496530
register: _verify_http
497531

@@ -503,7 +537,7 @@
503537
══════════════════════════════════════════
504538
dnsmasq : Proxy DHCP + TFTP on {{ pxe_network_interface }}
505539
NFS : {{ pxe_nfs_root }} → {{ pxe_subnet }}
506-
Apache : http://{{ pxe_controller_ip }}/k3s/
540+
Apache : http://{{ pxe_controller_ip }}:{{ pxe_web_port }}/k3s/
507541
Kernel : {{ pxe_kernel_version | default('unknown') }}
508542
──────────────────────────────────────────
509543
Next steps (see the Multi-AIPC PXE deployment guide):
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Managed by Ansible (pxe_controller role) -- do not edit by hand.
2+
#
3+
# The PXE controller only needs plain HTTP to hand the k3s token / kubeconfig to
4+
# netbooting agents. It listens on {{ pxe_web_port }} (not 80) so it can coexist
5+
# with k3s Traefik / ServiceLB, which binds host port 80/443 for cluster ingress.
6+
Listen {{ pxe_web_port }}

deploy/ansible/roles/pxe_controller/templates/k3s-auto-join.sh.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ set -euo pipefail
33

44
PXE_SERVER="{{ pxe_controller_ip }}"
55
K3S_SERVERS="{{ pxe_k3s_server_ips | join(' ') }}"
6-
TOKEN_URL="http://${PXE_SERVER}/k3s/token"
7-
KUBECONFIG_URL="http://${PXE_SERVER}/k3s/kubeconfig"
6+
TOKEN_URL="http://${PXE_SERVER}:{{ pxe_web_port }}/k3s/token"
7+
KUBECONFIG_URL="http://${PXE_SERVER}:{{ pxe_web_port }}/k3s/kubeconfig"
88
K3S_DATA="{{ pxe_k3s_data_dir }}"
99

1010
HOSTNAME=$(hostname)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Mount local disk for k3s container image cache
3+
Before=k3s-auto-join.service
4+
After=local-fs.target
5+
6+
[Service]
7+
Type=oneshot
8+
ExecStart=/usr/local/bin/mount-local-disk.sh
9+
RemainAfterExit=yes
10+
11+
[Install]
12+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)