Skip to content

Commit 6612281

Browse files
committed
Genesify notification project
Signed-off-by: Anton Kremenetsky <anton.kremenetsky@gmail.com>
1 parent f2c1cff commit 6612281

File tree

5 files changed

+107
-30
lines changed

5 files changed

+107
-30
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,16 @@ jobs:
1515
fail-fast: true
1616
steps:
1717
- uses: actions/checkout@v5
18-
- name: Build Genesis Core
18+
with:
19+
fetch-depth: 30
20+
- name: Build Genesis Notification
21+
env:
22+
PUSH_CFG: ${{ secrets.PUSH_CFG }}
1923
run: |
2024
set -eux
2125
22-
genesis build $(pwd)
26+
genesis build $(pwd) --inventory
2327
24-
VERSION="$(genesis get-version .)"
25-
26-
# Prepare `raw` and `raw.gz` images
27-
cd output
28-
qemu-img convert -f qcow2 genesis-notification.qcow2 -O raw genesis-notification.raw
29-
gzip -5 -k < genesis-notification.raw > genesis-notification.raw.gz
30-
31-
# Upload the VM images
32-
curl -X PUT --upload-file genesis-notification.qcow2 \
33-
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/genesis-notification.qcow2
34-
curl -X PUT --upload-file genesis-notification.raw.gz \
35-
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/genesis-notification.raw.gz
36-
curl -X PUT --upload-file genesis-notification.raw \
37-
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/genesis-notification.raw
38-
39-
sha256sum genesis-notification.qcow2 >> SHA256SUMS
40-
sha256sum genesis-notification.raw.gz >> SHA256SUMS
41-
sha256sum genesis-notification.raw >> SHA256SUMS
42-
43-
curl -X PUT --upload-file SHA256SUMS \
44-
${REPO_ENDPOINT_PUT}/${PROJECT_NAME}/${VERSION}/SHA256SUMS
45-
cd -
28+
# Decode and write the push configuration
29+
echo "$PUSH_CFG" | base64 -d > genesis/genesis.push.yaml
30+
genesis push -c genesis/genesis.push.yaml -t local -f

genesis/genesis.yaml

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,50 @@
1+
# Copyright 2026 Genesis developers.
2+
#
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
# Build section. It specifies the build process of the project elements
118
build:
19+
20+
# Dependencies of the project
221
deps:
322
- dst: /opt/genesis_notification
23+
# Local path
424
path:
525
src: ../../genesis_notification
26+
exclude:
27+
- .venv
28+
- .tox
29+
- .pytest_cache
30+
- .ruff_cache
31+
- build
32+
- cover
33+
- output
634

35+
# List of elements in the project
736
elements:
8-
- images:
37+
- manifest: manifests/genesis_notification.yaml.j2
38+
images:
939
- name: genesis-notification
10-
format: qcow2
40+
format: gz
41+
42+
# OS profile for the image
1143
profile: genesis_base
44+
45+
# Provisioning script
1246
script: images/install.sh
1347

14-
# Override image build parameters, for instance a disk size
1548
override:
16-
disk_size: "6G"
49+
# For development purposes it's handy to have more space.
50+
disk_size: "8G"

genesis/images/bootstrap.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2026 Genesis developers.
4+
#
5+
# All Rights Reserved.
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8+
# not use this file except in compliance with the License. You may obtain
9+
# a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
19+
set -eu
20+
set -x
21+
set -o pipefail

genesis/images/install.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Copyright 2025 Genesis Corporation
3+
# Copyright 2026 Genesis developers.
44
#
55
# All Rights Reserved.
66
#
@@ -71,4 +71,19 @@ sudo cp "$GC_PATH/etc/systemd/genesis-notification-user-api.service" $SYSTEMD_SE
7171
sudo systemctl enable \
7272
genesis-notification-mail-agent \
7373
genesis-notification-builder-agent \
74-
genesis-notification-user-api
74+
genesis-notification-user-api
75+
76+
77+
cat <<EOT | sudo tee /etc/motd
78+
▄▖ ▘
79+
▌ █▌▛▌█▌▛▘▌▛▘
80+
▙▌▙▖▌▌▙▖▄▌▌▄▌
81+
82+
83+
Welcome to genesis_notification node!
84+
85+
86+
The project page:
87+
https://github.com/infraguys/genesis_notification
88+
89+
EOT
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "genesis_notification"
2+
description: "Genesis notification element"
3+
schema_version: 1
4+
version: "{{ version }}"
5+
api_version: "v1"
6+
7+
requirements:
8+
core:
9+
from_version: "0.0.0"
10+
11+
resources:
12+
$core.compute.sets:
13+
genesis_notification_set:
14+
name: "genesis-notification"
15+
project_id: "12345678-c625-4fee-81d5-f691897b8142"
16+
cores: 1
17+
ram: 1024
18+
replicas: 1
19+
disk_spec:
20+
kind: "root_disk"
21+
size: 10
22+
image: "{{ repository | default('https://repository.genesis-core.tech/genesis-elements') }}/genesis_notification/{{ version }}/images/genesis-notification.raw.gz"

0 commit comments

Comments
 (0)