Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/actions/common-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ runs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Load cached venv
uses: actions/cache@v4
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/gcm_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- uses: actions/cache@v4
id: cache-venv
Expand Down Expand Up @@ -53,19 +53,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Load cached venv
uses: actions/cache@v4
with:
path: ~/.cache/venv-ci
key: ${{ env.pythonLocation }}-${{ hashFiles('dev-requirements.txt') }}

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
cp -r $HOME/.cargo/bin/* $HOME/.cache/venv-ci/bin/

- name: Install build dependencies
run: |
sudo apt update --yes
Expand Down Expand Up @@ -147,7 +142,7 @@ jobs:
source ~/.cache/venv-ci/bin/activate
nox -s format

pyoxidizer-build-gcm:
pyinstaller-build-gcm:
needs: setup-venv
strategy:
matrix:
Expand All @@ -165,9 +160,9 @@ jobs:
make release/gcm

- name: Test built binary
run: ./build/x86_64-unknown-linux-gnu/release/install_gcm/gcm --help
run: ./dist/gcm/gcm --help

pyoxidizer-build-health_checks:
pyinstaller-build-health_checks:
needs: setup-venv
strategy:
matrix:
Expand All @@ -185,4 +180,4 @@ jobs:
make release/health_checks

- name: Test built binary
run: ./build/x86_64-unknown-linux-gnu/release/install_hc/health_checks --help
run: ./dist/health_checks/health_checks --help
4 changes: 2 additions & 2 deletions .github/workflows/meta_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- uses: actions/cache@v4
id: cache-venv
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Load cached venv
uses: actions/cache@v4
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- uses: actions/cache@v4
id: cache-venv
Expand Down Expand Up @@ -122,19 +122,14 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Load cached venv
uses: actions/cache@v4
with:
path: ~/.cache/venv-ci
key: ${{ env.pythonLocation }}-${{ hashFiles('dev-requirements.txt') }}

- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
cp -r $HOME/.cargo/bin/* $HOME/.cache/venv-ci/bin/

- name: Install build dependencies
run: |
sudo apt update --yes
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ share/python-wheels/
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -278,3 +275,4 @@ go.work.sum
# Editor/IDE
# .idea/
# .vscode/
.claude/
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
# All rights reserved.
SHELL:=/bin/bash -o pipefail -o errexit -o nounset

PYOX_DEBUG_OUT=build/x86_64-unknown-linux-gnu/debug
PYOX_RELEASE_OUT=build/x86_64-unknown-linux-gnu/release
# PyInstaller output directories
PYINSTALLER_OUT=dist
GCM_SRCS:=$(shell find gcm/ -type f -name '*py')
VERSION:=$(shell cat gcm/version.txt)

.PHONY: all
all: gcm, health_checks
all: gcm health_checks

.PHONY: clean
clean: clean_pyox
clean: clean_pyinstaller

.PHONY: gcm
gcm: $(PYOX_DEBUG_OUT)/install/gcm
gcm: $(PYINSTALLER_OUT)/gcm/gcm

$(PYOX_RELEASE_OUT)/install/gcm: pyoxidizer.bzl requirements.txt $(GCM_SRCS)
pyoxidizer build --release --var VERSION $(VERSION) gcm resources_gcm install_gcm
$(PYINSTALLER_OUT)/gcm/gcm: gcm.spec requirements.txt $(GCM_SRCS)
GCM_VERSION=$(VERSION) pyinstaller gcm.spec --noconfirm

.PHONY: release/gcm
release/gcm: $(PYOX_RELEASE_OUT)/install/gcm
release/gcm: $(PYINSTALLER_OUT)/gcm/gcm

.PHONY: health_checks
health_checks: $(PYOX_DEBUG_OUT)/install/health_checks
health_checks: $(PYINSTALLER_OUT)/health_checks/health_checks

$(PYOX_RELEASE_OUT)/install/health_checks: pyoxidizer.bzl requirements.txt $(GCM_SRCS)
pyoxidizer build --release --var VERSION $(VERSION) health_checks resources_hc install_hc
$(PYINSTALLER_OUT)/health_checks/health_checks: health_checks.spec requirements.txt $(GCM_SRCS)
GCM_VERSION=$(VERSION) pyinstaller health_checks.spec --noconfirm

.PHONY: release/health_checks
release/health_checks: $(PYOX_RELEASE_OUT)/install/health_checks
release/health_checks: $(PYINSTALLER_OUT)/health_checks/health_checks

.PHONY: clean_pyox
clean_pyox:
rm -rf $(PYOX_DEBUG_OUT) $(PYOX_RELEASE_OUT)
.PHONY: clean_pyinstaller
clean_pyinstaller:
rm -rf $(PYINSTALLER_OUT) build

requirements.txt: pyproject.toml
pip-compile --no-emit-options --generate-hashes --no-reuse-hashes --allow-unsafe --resolver=backtracking -o requirements.txt pyproject.toml
Expand Down
20 changes: 16 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@ GCM_HC_LIB:=debian/gcm/usr/lib/hc/hc_lib

override_dh_auto_install:
mkdir -p ${GCM_LIB}
cp -r build/x86_64-unknown-linux-gnu/release/install_gcm/gcm_lib/* ${GCM_LIB}
cp build/x86_64-unknown-linux-gnu/release/install_gcm/gcm debian/gcm/usr/lib/gcm/gcm
# Copy PyInstaller dependencies
if [ -d dist/gcm/_internal ]; then \
cp -r dist/gcm/_internal/* ${GCM_LIB}/; \
else \
find dist/gcm -mindepth 1 -maxdepth 1 ! -name gcm -exec cp -r {} ${GCM_LIB}/ \; ; \
fi
# Copy gcm executable
cp dist/gcm/gcm debian/gcm/usr/lib/gcm/gcm

cp systemd/hc_resources.slice ${SYSTEMD_OUT}
cp systemd/sacct_backfill.service ${SYSTEMD_OUT}
Expand All @@ -27,5 +33,11 @@ override_dh_auto_install:
cp systemd/storage.service ${SYSTEMD_OUT}

mkdir -p ${GCM_HC_LIB}
cp -r build/x86_64-unknown-linux-gnu/release/install_hc/hc_lib/* ${GCM_HC_LIB}
cp build/x86_64-unknown-linux-gnu/release/install_hc/health_checks debian/healthchecks/usr/bin
# Copy PyInstaller dependencies
if [ -d dist/health_checks/_internal ]; then \
cp -r dist/health_checks/_internal/* ${GCM_HC_LIB}/; \
else \
find dist/health_checks -mindepth 1 -maxdepth 1 ! -name health_checks -exec cp -r {} ${GCM_HC_LIB}/ \; ; \
fi
# Copy health_checks executable
cp dist/health_checks/health_checks debian/healthchecks/usr/bin
Loading
Loading