Skip to content

Commit 28ea9ca

Browse files
authored
Merge branch 'main' into quadratic-voting
2 parents 92751a2 + 1bdacb3 commit 28ea9ca

33 files changed

+989
-464
lines changed

.github/workflows/ci-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ jobs:
2323
- uses: actions/checkout@v4
2424

2525
- name: Install Forge
26-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.5.3
26+
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.8.1
2727
with:
28-
version: 0.8.0
28+
version: 0.19.1
2929
if: always()
3030

3131
- name: Setup CI
32-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.5.3
32+
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.8.1
3333

3434
- name: Run tests
35-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.5.3
35+
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.8.1
3636
if: always()
3737
continue-on-error: true
3838
with:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ permissions:
1010

1111
jobs:
1212
ci:
13-
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.5.3
13+
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.8.1
1414
with:
15-
forge_version: 0.8.1
15+
forge_version: 0.19.1

.github/workflows/mdlint-changed.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

Earthfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ all:
9292
END
9393

9494
# Build and tag all Docker images
95-
BUILD ./containers/event-db-migrations+publish --tag=$tag --registry=$registry_final
95+
BUILD ./containers/event-db-migrations+package --tag=$tag --registry=$registry_final
9696

9797
# Build crate images from the workspace
9898
BUILD ./src/jormungandr/jormungandr+docker --tag=$tag --registry=$registry_final
9999
BUILD ./src/jormungandr/jcli+docker --tag=$tag --registry=$registry_final
100100
BUILD ./src/catalyst-toolbox/catalyst-toolbox+docker --tag=$tag --registry=$registry_final
101101
BUILD ./src/voting-tools-rs+docker --tag=$tag --registry=$registry_final
102-
BUILD ./src/cat-data-service+publish --tag=$tag --registry=$registry_final
102+
BUILD ./src/cat-data-service+docker --tag=$tag --registry=$registry_final
103103

104-
BUILD ./services/voting-node+publish --tag=$tag --registry=$registry_final
104+
BUILD ./services/voting-node+package --tag=$tag --registry=$registry_final
105105
BUILD ./utilities/ideascale-importer+docker --tag=$tag --registry=$registry_final
106106

107107
all-with-tags:
@@ -147,9 +147,9 @@ tag-workspace:
147147

148148
local:
149149
LOCALLY
150-
BUILD ./containers/event-db-migrations+publish
151-
BUILD ./src/cat-data-service+publish
152-
BUILD ./services/voting-node+publish
150+
BUILD ./containers/event-db-migrations+package
151+
BUILD ./src/cat-data-service+docker
152+
BUILD ./services/voting-node+package
153153

154154
RUN mkdir -p ./local
155155
COPY ./containers/dev-local+build/docker-compose.yml ./local/

blueprint.cue

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
global: {
2+
ci: {
3+
local: [
4+
"^check(-.*)?$",
5+
"^build(-.*)?$",
6+
"^package(-.*)?$",
7+
"^test(-.*)?$",
8+
]
9+
registries: [
10+
ci.providers.aws.ecr.registry,
11+
]
12+
providers: {
13+
aws: {
14+
region: "eu-central-1"
15+
ecr: registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
16+
role: "arn:aws:iam::332405224602:role/ci"
17+
}
18+
19+
docker: credentials: {
20+
provider: "aws"
21+
path: "global/ci/docker"
22+
}
23+
24+
git: credentials: {
25+
provider: "aws"
26+
path: "global/ci/deploy"
27+
}
28+
29+
earthly: {
30+
satellite: credentials: {
31+
provider: "aws"
32+
path: "global/ci/ci-tls"
33+
}
34+
version: "0.8.16"
35+
}
36+
37+
github: registry: "ghcr.io"
38+
39+
tailscale: {
40+
credentials: {
41+
provider: "aws"
42+
path: "global/ci/tailscale"
43+
}
44+
tags: "tag:cat-github"
45+
version: "latest"
46+
}
47+
}
48+
secrets: [
49+
{
50+
name: "GITHUB_TOKEN"
51+
optional: true
52+
provider: "env"
53+
path: "GITHUB_TOKEN"
54+
},
55+
]
56+
}
57+
deployment: {
58+
registries: {
59+
containers: ci.providers.aws.ecr.registry
60+
modules: ci.providers.aws.ecr.registry + "/catalyst-deployments"
61+
}
62+
repo: {
63+
url: "https://github.com/input-output-hk/catalyst-world"
64+
ref: "master"
65+
}
66+
root: "k8s"
67+
}
68+
repo: {
69+
defaultBranch: "main"
70+
name: "input-output-hk/catalyst-core"
71+
}
72+
}

containers/event-db-migrations/Earthfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ build:
1212
SAVE ARTIFACT ./bin/refinery refinery
1313
SAVE IMAGE --cache-hint
1414

15-
publish:
15+
package:
1616
FROM debian:stable-slim
1717
ARG tag="latest"
1818
ARG data="historic"
@@ -63,3 +63,11 @@ publish:
6363
# --load test:latest=+docker
6464
# RUN docker run test:latest
6565
# END
66+
67+
docker:
68+
FROM +package
69+
70+
ARG container='migrations'
71+
ARG tag="latest"
72+
73+
SAVE IMAGE ${container}:${tag}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
project: {
2+
name: "event-db-migrations"
3+
deployment: {
4+
on: {
5+
merge: {}
6+
tag: {}
7+
}
8+
9+
bundle:
10+
{
11+
env: string | *"dev"
12+
_env: env
13+
modules: main: {
14+
name: "app"
15+
version: "0.11.1"
16+
values: {
17+
jobs: migration: containers: main: {
18+
image: {
19+
name: _ @forge(name="CONTAINER_IMAGE")
20+
tag: _ @forge(name="GIT_HASH_OR_TAG")
21+
}
22+
env: {
23+
DB_HOST: {
24+
secret: {
25+
name: "db"
26+
key: "host"
27+
}
28+
}
29+
DB_NAME: {
30+
value: "eventdb"
31+
}
32+
DB_PORT: {
33+
secret: {
34+
name: "db"
35+
key: "port"
36+
}
37+
}
38+
DB_ROOT_NAME: {
39+
value: "postgres"
40+
}
41+
DB_SUPERUSER: {
42+
secret: {
43+
name: "root"
44+
key: "username"
45+
}
46+
}
47+
DB_SUPERUSER_PASSWORD: {
48+
secret: {
49+
name: "root"
50+
key: "password"
51+
}
52+
}
53+
DB_USER: {
54+
secret: {
55+
name: "db"
56+
key: "username"
57+
}
58+
}
59+
DB_USER_PASSWORD: {
60+
secret: {
61+
name: "db"
62+
key: "password"
63+
}
64+
}
65+
INIT_AND_DROP_DB: {
66+
value: string | *"true"
67+
}
68+
STAGE: {
69+
value: string | *_env
70+
}
71+
}
72+
mounts: state: {
73+
ref: volume: name: "state"
74+
path: "/eventdb/tmp"
75+
readOnly: false
76+
}
77+
resources: requests: {
78+
cpu: "100m"
79+
memory: "128Mi"
80+
}
81+
}
82+
83+
secrets: {
84+
db: {
85+
ref: "db/eventdb"
86+
}
87+
root: {
88+
ref: "db/root_account"
89+
}
90+
}
91+
92+
volumes: state: {
93+
size: "1Mi"
94+
}
95+
}
96+
}
97+
}
98+
}
99+
100+
release: {
101+
docker: {
102+
on: {
103+
merge: {}
104+
tag: {}
105+
}
106+
config: {
107+
tag: _ @forge(name="GIT_HASH_OR_TAG")
108+
}
109+
}
110+
}
111+
}

services/voting-node/Earthfile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,19 @@ deps:
4848
COPY --dir voting_node README.md ./
4949

5050
SAVE ARTIFACT .venv .venv
51-
SAVE IMAGE --cache-hint
51+
52+
lock:
53+
FROM +builder
54+
55+
WORKDIR /src/services/voting-node
56+
57+
COPY pyproject.toml .
58+
COPY poetry.lock .
59+
COPY ../../utilities/ideascale-importer+build/src /src/utilities/ideascale-importer
60+
61+
RUN poetry lock
62+
63+
SAVE ARTIFACT ./poetry.lock AS LOCAL poetry.lock
5264

5365
# Build for distribution
5466
build:
@@ -91,7 +103,7 @@ pdoc:
91103
SAVE ARTIFACT /doc
92104

93105
# Docker image built for distribution and use in production.
94-
publish:
106+
package:
95107
FROM python:3.11-slim-bullseye
96108
ARG tag="latest"
97109

@@ -165,3 +177,11 @@ integration-test:
165177
--service leader0
166178
RUN docker-compose run leader0 echo "<<<INTEGRATION TESTING GOES HERE>>>"
167179
END
180+
181+
docker:
182+
FROM +package
183+
184+
ARG container='voting-node'
185+
ARG tag="latest"
186+
187+
SAVE IMAGE ${container}:${tag}

0 commit comments

Comments
 (0)