Skip to content

Commit 2b2d2b3

Browse files
authored
Merge branch 'main' into cocoon-dep-fix
2 parents 9ee1d05 + 4f4d904 commit 2b2d2b3

File tree

17 files changed

+299
-114
lines changed

17 files changed

+299
-114
lines changed

.github/workflows/ci-test.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ permissions:
1111
packages: write
1212

1313
env:
14-
AWS_REGION: eu-central-1
15-
AWS_ROLE_ARN: arn:aws:iam::332405224602:role/ci
16-
ECR_REGISTRY: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
1714
TAG: ${{ github.sha }}
1815

1916
jobs:
@@ -24,20 +21,20 @@ jobs:
2421
FORCE_COLOR: 1
2522
steps:
2623
- uses: actions/checkout@v4
24+
25+
- name: Install Forge
26+
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.7.1
2727
with:
28-
fetch-depth: 0
28+
version: 0.14.0
29+
if: always()
30+
2931
- name: Setup CI
30-
uses: input-output-hk/catalyst-ci/actions/setup@master
31-
with:
32-
aws_role_arn: ${{ env.AWS_ROLE_ARN }}
33-
aws_region: ${{ env.AWS_REGION }}
34-
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
35-
- name: Login to ECR
36-
uses: docker/login-action@v2
37-
with:
38-
registry: ${{ env.ECR_REGISTRY }}
32+
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.7.1
33+
3934
- name: Run tests
40-
env:
41-
EARTHLY_SECRETS: "IDEASCALE_EMAIL=${{ secrets.IDEASCALE_EMAIL }}, IDEASCALE_PASSWORD=${{ secrets.IDEASCALE_PASSWORD }}, IDEASCALE_API_TOKEN=${{ secrets.IDEASCALE_API_TOKEN }}"
42-
run: |
43-
earthly -P --buildkit-host "tcp://${{ secrets.EARTHLY_SATELLITE_ADDRESS }}:8372" +test-all
35+
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.7.1
36+
if: always()
37+
continue-on-error: true
38+
with:
39+
command: run
40+
args: ./+test-all

.github/workflows/ci.yml

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

1111
jobs:
1212
ci:
13-
uses: input-output-hk/catalyst-ci/.github/workflows/ci.yml@master
13+
uses: input-output-hk/catalyst-forge/.github/workflows/ci.yml@ci/v1.7.1
1414
with:
15-
aws_ecr_registry: 332405224602.dkr.ecr.eu-central-1.amazonaws.com
16-
aws_role_arn: arn:aws:iam::332405224602:role/ci
17-
aws_region: eu-central-1
18-
publish_docs: false
19-
secrets:
20-
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
21-
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
22-
earthly_runner_address: ${{ secrets.EARTHLY_SATELLITE_ADDRESS }}
23-
earthly_runner_secret: ${{ secrets.EARTHLY_RUNNER_SECRET }}
15+
forge_version: 0.14.0

.github/workflows/mdlint-changed.yml

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

.github/workflows/stale-branches.yml

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

Earthfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ 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
@@ -101,7 +101,7 @@ all:
101101
BUILD ./src/voting-tools-rs+docker --tag=$tag --registry=$registry_final
102102
BUILD ./src/cat-data-service+publish --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
150+
BUILD ./containers/event-db-migrations+package
151151
BUILD ./src/cat-data-service+publish
152-
BUILD ./services/voting-node+publish
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: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: "1.0"
2+
global: {
3+
ci: {
4+
local: [
5+
"^check(-.*)?$",
6+
"^build(-.*)?$",
7+
"^package(-.*)?$",
8+
"^test(-.*)?$",
9+
]
10+
registries: [
11+
ci.providers.aws.ecr.registry,
12+
]
13+
providers: {
14+
aws: {
15+
region: "eu-central-1"
16+
ecr: registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
17+
role: "arn:aws:iam::332405224602:role/ci"
18+
}
19+
20+
docker: credentials: {
21+
provider: "aws"
22+
path: "global/ci/docker"
23+
}
24+
25+
git: credentials: {
26+
provider: "aws"
27+
path: "global/ci/deploy"
28+
}
29+
30+
earthly: {
31+
credentials: {
32+
provider: "aws"
33+
path: "global/ci/earthly"
34+
}
35+
org: "Catalyst"
36+
satellite: "ci"
37+
version: "0.8.15"
38+
}
39+
40+
github: registry: "ghcr.io"
41+
42+
kcl: {
43+
install: true
44+
version: "v0.11.0"
45+
}
46+
}
47+
secrets: [
48+
{
49+
name: "GITHUB_TOKEN"
50+
optional: true
51+
provider: "env"
52+
path: "GITHUB_TOKEN"
53+
},
54+
]
55+
}
56+
repo: {
57+
defaultBranch: "main"
58+
name: "input-output-hk/catalyst-core"
59+
}
60+
}

containers/event-db-migrations/Earthfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ build:
77
FROM +deps
88

99
# Build refinery
10-
RUN cargo install refinery_cli --version 0.8.7 --root .
10+
RUN cargo install refinery_cli --version 0.8.14 --locked --root .
1111

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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: "1.0.0"
2+
project: {
3+
name: "event-db-migrations"
4+
release: {
5+
docker: {
6+
on: {
7+
merge: {}
8+
tag: {}
9+
}
10+
config: {
11+
tag: _ @forge(name="GIT_HASH_OR_TAG")
12+
}
13+
}
14+
}
15+
}

docker/voting-node.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM jormungandr:latest as jorm
88

99
# stage 3
1010
FROM python as poetry
11-
RUN pip install poetry
11+
RUN pip install poetry==2.0.1
1212

1313
# Add python codebase
1414
COPY . /voting

services/voting-node/Earthfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ builder:
2121
zlib1g-dev
2222

2323
# Install Poetry
24-
RUN curl -sSL https://install.python-poetry.org | python3 -
24+
RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.0.1
2525

2626
SAVE IMAGE --cache-hint
2727

@@ -42,7 +42,8 @@ deps:
4242
RUN poetry config installer.max-workers 10
4343
# Install package dependencies without the voting_node package
4444
RUN poetry install --only main --no-root
45-
45+
RUN poetry self add poetry-plugin-export
46+
4647
# Copy the voting_node source code
4748
COPY --dir voting_node README.md ./
4849

@@ -90,7 +91,7 @@ pdoc:
9091
SAVE ARTIFACT /doc
9192

9293
# Docker image built for distribution and use in production.
93-
publish:
94+
package:
9495
FROM python:3.11-slim-bullseye
9596
ARG tag="latest"
9697

@@ -164,3 +165,11 @@ integration-test:
164165
--service leader0
165166
RUN docker-compose run leader0 echo "<<<INTEGRATION TESTING GOES HERE>>>"
166167
END
168+
169+
docker:
170+
FROM +package
171+
172+
ARG container='voting-node'
173+
ARG tag="latest"
174+
175+
SAVE IMAGE ${container}:${tag}

0 commit comments

Comments
 (0)