Skip to content

Commit 283728d

Browse files
committed
chore: initial commit
Signed-off-by: Myroslav Kiurchev <kiurchv@gmail.com>
0 parents  commit 283728d

5 files changed

Lines changed: 281 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
# env:
12+
# # Keep in sync with jobs.build.container.image!
13+
# BRANCH: v3.21
14+
# REPOS_DIR: /home/ci/repos
15+
# BUILD_REPOS: backports user
16+
# PACKAGER_KEYNAME: jakub@jirutka.cz-655775c4.rsa
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
container:
22+
image: alpine:${{ vars.RELEASE_BRANCH }}
23+
# options: --privileged --device /dev/fuse
24+
volumes:
25+
- ${{ github.workspace }}:/home/ci/aports
26+
# - /tmp:/tmp
27+
steps:
28+
- name: Checkout aports repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 10
32+
33+
- name: Setup packager keys
34+
run: |
35+
KEY_DIR=$(mktemp -d -t keys-XXXXXX)
36+
echo "${{ secrets.RSA_PUBLIC_KEY }}" > /etc/apk/keys/packager.rsa.pub
37+
echo "${{ secrets.RSA_PUBLIC_KEY }}" > $KEY_DIR/packager.rsa.pub
38+
echo "${{ secrets.RSA_PRIVATE_KEY }}" > $KEY_DIR/packager.rsa
39+
mkdir -p /home/ci/.abuild
40+
echo "PACKAGER_PRIVKEY=$KEY_DIR/packager.rsa" > /home/ci/.abuild/abuild.conf
41+
42+
- name: Configure Alpine repositories
43+
run: |
44+
rm /etc/apk/repositories
45+
printf -- >> /etc/apk/repositories \
46+
"http://dl-cdn.alpinelinux.org/alpine/$(test edge != ${{ vars.RELEASE_BRANCH }} && echo v)${{ vars.RELEASE_BRANCH }}/%s\n" \
47+
main community $(test edge = ${{ vars.RELEASE_BRANCH }} && echo testing)
48+
apk upgrade -U --available
49+
50+
- name: Install packages
51+
run: apk add alpine-sdk lua-aports
52+
53+
- name: Set current directory as a safe directory
54+
run: git config --global --add safe.directory ${{ github.workspace }}
55+
56+
- name: Prepare environment
57+
# working-directory: /home/ci
58+
run: |
59+
adduser -u 1001 -G abuild -s /bin/sh -D ci
60+
addgroup ci wheel
61+
install -d -g abuild -m 775 /var/cache/distfiles
62+
chown -R ci:abuild /home/ci
63+
# patch -d / -p 1 < aports/.github/workflows/files/abuild-sign.patch
64+
# patch -d / -p 1 < aports/.github/workflows/files/buildrepo.patch
65+
sed -i "s/JOBS=[0-9]*/JOBS=$(nproc)/" /etc/abuild.conf
66+
67+
- name: Build packages
68+
working-directory: /home/ci/aports
69+
run: |
70+
REPOS_DIR=$(mktemp -d -t repos-XXXXXX)
71+
chown -R ci:abuild $REPOS_DIR
72+
export REPODIR="$REPOS_DIR/alpine/$(test edge != ${{ vars.RELEASE_BRANCH }} && echo v)${{ vars.RELEASE_BRANCH }}"
73+
74+
# Prepare arguments
75+
args=''
76+
if git log -1 --pretty=format:'%s %b' | grep -q -- '/keep-going'; then
77+
args='--keep-going'
78+
fi
79+
for repo in ${{ vars.BUILD_REPOS }}; do
80+
if [ -n "$(find $repo -maxdepth 2 -name APKBUILD)" ]; then
81+
args="$args $repo"
82+
fi
83+
done
84+
85+
echo "ghws: $GITHUB_WORKSPACE"
86+
echo "args: $args"
87+
# su ci sh -c 'buildrepo -d $REPODIR $@' -- $args
88+
su ci sh -c 'buildrepo -d $REPODIR $@' -- $args
89+
90+
ls -lAh $REPODEST

non-free/nomad/APKBUILD

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Contributor: Matthias Neugebauer <mtneug@mailbox.org>
2+
# Contributor: omni <omni+alpine@hack.org>
3+
# Contributor: Dermot Bradley <dermot_bradley@yahoo.com>
4+
# Maintainer: Dermot Bradley <dermot_bradley@yahoo.com>
5+
pkgname=nomad
6+
#
7+
# Please do NOT do "drive by" upgrades of this package. If only a few
8+
# days have passed since an upstream release has occurred then it is
9+
# highly likely that I am *already* preparing an Alpine package upgrade.
10+
#
11+
pkgver=1.9.6
12+
# remember to update _gitcommit to revision of the release
13+
_gitcommit=7f8b449
14+
pkgrel=0
15+
pkgdesc="easy-to-use, flexible, and performant workload orchestrator"
16+
url="https://www.nomadproject.io/"
17+
arch="all !riscv64" # riscv64: boltdb fails to build
18+
license="BUSL-1.1"
19+
depends="
20+
cni-plugins
21+
"
22+
makedepends="
23+
bash
24+
go
25+
go-bindata-assetfs
26+
linux-headers
27+
make
28+
"
29+
subpackages="
30+
$pkgname-openrc
31+
"
32+
options="net !check" # cannot produce environment for testing in CI
33+
source="$pkgname-$pkgver.tar.gz::https://github.com/hashicorp/nomad/archive/v$pkgver.tar.gz
34+
nomad.initd
35+
nomad.confd
36+
server.hcl
37+
"
38+
39+
# secfixes:
40+
# 1.5.3-r0:
41+
# - CVE-2023-24534
42+
# - CVE-2023-1782
43+
# 1.5.1-r0:
44+
# - CVE-2023-1296
45+
# - CVE-2023-1299
46+
# 1.3.1-r0:
47+
# - CVE-2022-30324
48+
# 1.2.6-r0:
49+
# - CVE-2022-24683
50+
# - CVE-2022-24684
51+
# - CVE-2022-24685
52+
# - CVE-2022-24686
53+
# - CVE-2021-44716
54+
# - CVE-2021-44717
55+
# - CVE-2021-43415
56+
# - CVE-2021-37218
57+
# 1.1.1-r0:
58+
# - CVE-2021-32575
59+
# 1.0.4-r0:
60+
# - CVE-2021-3283
61+
# 0.12.7-r0:
62+
# - CVE-2020-28348
63+
# - CVE-2020-27195
64+
# 0.11.1-r0:
65+
# - CVE-2020-10944
66+
# 0.10.3-r0:
67+
# - CVE-2020-7218
68+
# 0.9.6-r0:
69+
# - CVE-2019-12741
70+
# - CVE-2019-15928
71+
# - CVE-2019-16742
72+
# 0.9.5-r0:
73+
# - CVE-2019-14802
74+
# - CVE-2019-14803
75+
# 0.9.2-r0:
76+
# - CVE-2019-12618
77+
78+
export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw"
79+
export GIT_COMMIT="$_gitcommit"
80+
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
81+
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
82+
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
83+
84+
build() {
85+
go build -v -o bin/"$pkgname" \
86+
-ldflags "-X github.com/hashicorp/nomad/version.GitCommit='$pkgver'" \
87+
-tags "ui release"
88+
}
89+
90+
check() {
91+
go test -timeout=15m "./..."
92+
}
93+
94+
package() {
95+
install -m755 -D "$srcdir"/"$pkgname".initd "$pkgdir"/etc/init.d/"$pkgname"
96+
install -m644 -D "$srcdir"/"$pkgname".confd "$pkgdir"/etc/conf.d/"$pkgname"
97+
98+
install -m755 -d "$pkgdir"/etc/cni
99+
install -m755 -d "$pkgdir"/usr/lib/"$pkgname"/plugins
100+
101+
install -m755 -o root -g root -D bin/"$pkgname" "$pkgdir"/usr/sbin/"$pkgname"
102+
install -m640 -o root -g root -D "$srcdir"/server.hcl "$pkgdir"/etc/nomad.d/server.hcl
103+
install -m750 -o root -g root -d "$pkgdir"/var/lib/"$pkgname"
104+
}
105+
106+
sha512sums="
107+
4c2260f2f6a7cae7bc93c996dd57bc85ee55df66fc93f161e44e9b9f09b446f9e886013c602f20ccec8f14a574226a275624c2da1b897ceb5efcff7ab5fac0b7 nomad-1.9.6.tar.gz
108+
3431260365350ffce7b8ad81de9bb6bc3cfd1a8053bcacc780ca48c6878bf7018b7537b4c7fd6b4ead83e8ad1ac08b90e249f007fe88e167936417d495e88482 nomad.confd
109+
f26a7eb284530e568898820dea7b369319fa54d390330f939ad1d3bde16aaac84b31368d0d552acaa556db9e0d472ed1bde241478322f4afc688046fb58656e2 nomad.initd
110+
5c3157a9dc6c03d92b26f985d73726f1f451c9157df64676bd215ae5cb85fd1e748ccccdbcec3cf1678126744be4d95058e217da4a1c0260830424596a6d7191 server.hcl
111+
"

non-free/nomad/nomad.confd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
nomad_opts="agent -server -config=/etc/nomad.d"
2+
3+
#
4+
# If TLS is enabled on nomad then the health check defined in init.d (which
5+
# runs "nomad agent-info") will fail unless it also makes use of TLS.
6+
#
7+
# In that situation uncomment the following definition and ensure
8+
# it refers to the appropriate PEM files and URL.
9+
#
10+
#nomad_healthcheck_opts="-ca-cert=nomad-ca.pem -client-cert=cli.pem -client-key=cli-key.pem address=https://127.0.0.1:4646"

non-free/nomad/nomad.initd

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/sbin/openrc-run
2+
name="Nomad"
3+
description="An easy-to-use, flexible, and performant workload orchestrator"
4+
description_healthcheck="Check health status"
5+
description_reload="Reload configuration"
6+
7+
extra_started_commands="healthcheck reload"
8+
9+
command="/usr/sbin/${RC_SVCNAME}"
10+
command_args="${nomad_opts}"
11+
command_user="root:root"
12+
13+
supervisor=supervise-daemon
14+
output_log="/var/log/${RC_SVCNAME}.log"
15+
error_log="/var/log/${RC_SVCNAME}.log"
16+
respawn_max=0
17+
respawn_delay=10
18+
healthcheck_timer=60
19+
20+
depend() {
21+
need net
22+
after cgroups docker firewall
23+
}
24+
25+
start_pre() {
26+
checkpath -f -m 0644 -o "$command_user" "$output_log" "$error_log"
27+
}
28+
29+
healthcheck() {
30+
$command agent-info ${nomad_healthcheck_opts} > /dev/null 2>&1
31+
}
32+
33+
reload() {
34+
start_pre \
35+
&& ebegin "Reloading $RC_SVCNAME configuration" \
36+
&& $supervisor "$RC_SVCNAME" --signal HUP
37+
eend $?
38+
}

non-free/nomad/server.hcl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
data_dir = "/var/lib/nomad"
2+
disable_update_check = true
3+
# Logging is handled by supervise-daemon so disable
4+
# Syslog to avoid double logging.
5+
enable_syslog = false
6+
plugin_dir = "/usr/lib/nomad/plugins"
7+
8+
server {
9+
enabled = true
10+
bootstrap_expect = 1
11+
}
12+
13+
client {
14+
enabled = true
15+
16+
# CNI-related settings
17+
cni_config_dir = "/etc/cni"
18+
cni_path = "/usr/libexec/cni"
19+
20+
options {
21+
# Uncomment to disable some drivers
22+
#driver.denylist = "java,raw_exec"
23+
24+
# Disable some fingerprinting
25+
fingerprint.denylist = "env_aws,env_azure,env_digitalocean,env_gce"
26+
}
27+
}
28+
29+
ui {
30+
# Uncomment to enable UI, it will listen on port 4646
31+
#enabled = true
32+
}

0 commit comments

Comments
 (0)