Skip to content

Commit 34dc8ea

Browse files
committed
Use explicit repo for dev release tarball upload
1 parent c10719f commit 34dc8ea

3 files changed

Lines changed: 121 additions & 8 deletions

File tree

.github/workflows/dockers_deploy_and_test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ jobs:
219219
- name: Upload GEMC tarballs to release
220220
env:
221221
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
222+
REPO: ${{ github.repository }}
222223
shell: bash
223224
run: |
224225
shopt -s nullglob
@@ -228,9 +229,9 @@ jobs:
228229
echo "No GEMC tarballs found"
229230
exit 1
230231
fi
231-
gh release view "${TAG_NAME}" >/dev/null 2>&1 || \
232-
gh release create "${TAG_NAME}" --title "Dev Nightly" --prerelease --notes "Dev nightly release."
233-
gh release upload "${TAG_NAME}" "${tarballs[@]}" --clobber
232+
gh release view "${TAG_NAME}" --repo "$REPO" >/dev/null 2>&1 || \
233+
gh release create "${TAG_NAME}" --repo "$REPO" --title "Dev Nightly" --prerelease --notes "Dev nightly release."
234+
gh release upload "${TAG_NAME}" --repo "$REPO" "${tarballs[@]}" --clobber
234235
235236
236237
# Manifest stitch

.github/workflows/gemc_binary_tarball_test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Test GEMC binary tarballs in minimal OS images.
2-
name: Test GEMC Binary Tarballs
2+
name: Test Binary Tarballs
33

44
permissions:
55
contents: read
@@ -47,8 +47,7 @@ jobs:
4747
import sys
4848
4949
sys.path.insert(0, "ci")
50-
from functions import map_family
51-
from packages import packages_install_command
50+
from binary_packages import map_family, packages_install_command
5251
5352
image = sys.argv[1]
5453
tag = sys.argv[2]
@@ -64,8 +63,7 @@ jobs:
6463
print("RUN pacman -Sy --noconfirm archlinux-keyring")
6564
elif image == "almalinux":
6665
print("RUN dnf install -y 'dnf-command(config-manager)' \\")
67-
print(" && dnf config-manager --set-enabled crb \\")
68-
print(" && dnf install -y almalinux-release-synergy")
66+
print(" && dnf config-manager --set-enabled crb")
6967
7068
print(packages_install_command(image, tag))
7169
PY

ci/binary_packages.py

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#!/usr/bin/env python3
2+
import argparse
3+
4+
valid_images = ["fedora", "ubuntu", "archlinux", "almalinux", "debian"]
5+
6+
7+
def map_family(image: str) -> str:
8+
if image in ("almalinux", "centos"):
9+
return "fedora"
10+
if image == "ubuntu":
11+
return "debian"
12+
return image
13+
14+
15+
def unique_preserve_order(items):
16+
seen = set()
17+
out = []
18+
for item in items:
19+
if item not in seen:
20+
seen.add(item)
21+
out.append(item)
22+
return out
23+
24+
25+
pkg_sections = {
26+
"download_unpack": {
27+
"fedora": ["ca-certificates", "curl", "gzip", "tar"],
28+
"debian": ["ca-certificates", "curl", "gzip", "tar"],
29+
"archlinux": ["ca-certificates", "curl", "gzip", "tar"],
30+
},
31+
"core_runtime": {
32+
"fedora": ["expat", "sqlite-libs", "zlib"],
33+
"debian": ["libexpat1", "libsqlite3-0", "zlib1g"],
34+
"archlinux": ["expat", "sqlite", "zlib"],
35+
},
36+
"x11_gl": {
37+
"fedora": ["libX11", "libXext", "libXmu", "libXt", "mesa-libEGL", "mesa-libGL"],
38+
"debian": ["libegl1", "libgl1", "libx11-6", "libxext6", "libxmu6", "libxt6"],
39+
"archlinux": ["libx11", "libxext", "libxmu", "libxt", "mesa"],
40+
},
41+
"qt6": {
42+
"fedora": ["qt6-qtbase", "qt6-qtsvg"],
43+
"debian": ["libqt6core6t64", "libqt6gui6", "libqt6widgets6", "libqt6opengl6", "libqt6openglwidgets6", "libqt6svg6"],
44+
"archlinux": ["qt6-base", "qt6-svg"],
45+
},
46+
"other_linked_runtime": {
47+
"fedora": ["tbb"],
48+
"debian": ["libtbb12"],
49+
"archlinux": ["tbb"],
50+
},
51+
}
52+
53+
54+
def packages_to_be_installed(image: str, tag: str = "") -> str:
55+
if image not in valid_images:
56+
raise SystemExit(f"invalid image '{image}'; valid images: {', '.join(sorted(valid_images))}")
57+
58+
family = map_family(image)
59+
packages = []
60+
for section in pkg_sections.values():
61+
packages.extend(section.get(family, []))
62+
63+
return " ".join(unique_preserve_order(packages))
64+
65+
66+
def packages_install_command(image: str, tag: str = "") -> str:
67+
family = map_family(image)
68+
packages = packages_to_be_installed(image, tag)
69+
log = "/tmp/gemc-binary-packages-install.log"
70+
71+
if family == "fedora":
72+
return (
73+
"RUN /bin/bash -lc 'set -euo pipefail; "
74+
f"dnf install -y --allowerasing {packages} >{log} 2>&1 "
75+
f"|| {{ rc=$?; cat {log}; exit $rc; }}'"
76+
)
77+
78+
if family == "debian":
79+
return (
80+
"ENV DEBIAN_FRONTEND=noninteractive\n"
81+
"ENV DEBCONF_NONINTERACTIVE_SEEN=true\n"
82+
"ENV TZ=UTC\n"
83+
"RUN /bin/bash -lc 'set -euo pipefail; "
84+
"ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && "
85+
"apt-get update && "
86+
f"apt-get install -y --no-install-recommends tzdata {packages} >{log} 2>&1 "
87+
f"|| {{ rc=$?; cat {log}; exit $rc; }}'"
88+
)
89+
90+
if family == "archlinux":
91+
return (
92+
"RUN /bin/bash -lc 'set -euo pipefail; "
93+
f"pacman -Syu --noconfirm --needed {packages} >{log} 2>&1 "
94+
f"|| {{ rc=$?; cat {log}; exit $rc; }}'"
95+
)
96+
97+
return ""
98+
99+
100+
def main():
101+
parser = argparse.ArgumentParser(description="Return runtime packages for GEMC binary tarball tests")
102+
parser.add_argument("-i", "--image", required=True, help="Target base OS")
103+
parser.add_argument("-t", "--tag", default="", help="Target base OS tag")
104+
parser.add_argument("--command", action="store_true", help="Print a Dockerfile RUN command instead of the package list")
105+
args = parser.parse_args()
106+
107+
if args.command:
108+
print(packages_install_command(args.image, args.tag))
109+
else:
110+
print(packages_to_be_installed(args.image, args.tag))
111+
112+
113+
if __name__ == "__main__":
114+
main()

0 commit comments

Comments
 (0)