Skip to content

Commit 922bb92

Browse files
committed
[cli] feat: add automatic push to antithesis and accept test-run for trusted GH users
1 parent 575860f commit 922bb92

File tree

7 files changed

+324
-46
lines changed

7 files changed

+324
-46
lines changed

cli/CD/anti-agent/docker-compose.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,39 @@ services:
44
secrets:
55
- agent-wallet
66
- secrets
7+
- source: docker
8+
target: /run/secrets/docker/config.json
79
environment:
810
- ANTI_MPFS_HOST=https://mpfs.plutimus.com
911
- ANTI_WALLET_FILE=/run/secrets/agent-wallet
1012
- ANTI_TOKEN_ID=21c523c3b4565f1fc1ad7e54e82ca976f60997d8e7e9946826813fabf341069b
1113
- ANTI_SECRETS_FILE=/run/secrets/secrets
1214
- ANTI_WAIT=240
15+
- DOCKER_CONFIG=/run/secrets/docker
1316
restart:
1417
always
18+
privileged: true
1519
volumes:
1620
- tmp:/tmp
21+
# Mount CA certificates, curl seems not to find them when the pkgs.cacert is included in the image
22+
- /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro
23+
- /var/run/docker.sock:/var/run/docker.sock
1724
secrets:
1825
agent-wallet:
1926
file: /secrets/anti-agent/agent.json # Path to a file containing the wallet
2027
secrets:
2128
file: /secrets/anti-agent/secrets.yaml # Path to a file containing the secrets
29+
docker:
30+
file: /secrets/anti-agent/docker/config.json # Path to a file containing Docker config (for private registries)
2231

2332
volumes:
2433
tmp:
2534

2635
### Keys of the secrets.yaml file:
27-
# agentEmail:
28-
# agentEmailPassword:
29-
# githubPAT:
36+
# agentEmail: # Email address where url links are received
37+
# agentEmailPassword: # App password for the email account
38+
# githubPAT: # GitHub Personal Access Token
39+
# trustedRequesters:
40+
# - requester1
41+
# - requester2
42+
# antithesisPassword: # Password for Antithesis registry and Docker image

cli/justfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,33 @@ stop-mpfs:
130130
#!/usr/bin/env bash
131131
docker compose -p "anti-testing" -f test-E2E/fixtures/docker-compose.yml down
132132

133-
start-anti-agent bg="false":
133+
build-anti-agent:
134134
#!/usr/bin/env bash
135135
nix build .#anti-agent-docker-image
136136
docker load < result
137137
version=$(nix eval --raw .#version)
138138
docker image tag cardano-foundation/anti-agent:"$version" cardano-foundation/anti-agent:latest
139-
# shellcheck disable=SC2050
139+
140+
start-anti-agent bg="false":
141+
#!/usr/bin/env bash
140142
if [[ '{{ bg }}' == "true" ]]; then
141143
docker compose -f CD/anti-agent/docker-compose.yaml up -d
142144
else
143145
docker compose -f CD/anti-agent/docker-compose.yaml up
144146
fi
145147

148+
build-and-start-anti-agent bg="false":
149+
#!/usr/bin/env bash
150+
just build-anti-agent
151+
just start-anti-agent "{{ bg }}"
152+
146153
logs-anti-agent:
147154
#!/usr/bin/env bash
148-
docker compose -f CD/anti-agent/docker-compose.yaml logs -f
155+
docker compose -f CD/anti-agent/docker-compose.yaml logs -ft
149156

150157
start-anti-oracle bg="false":
151158
#!/usr/bin/env bash
152-
nix build .#anti-oracle-docker-image
159+
nix build .#anti-oracle-docker-image
153160
docker load < result
154161
version=$(nix eval --raw .#version)
155162
docker image tag cardano-foundation/anti-oracle:"$version" cardano-foundation/anti-oracle:latest
@@ -162,4 +169,4 @@ start-anti-oracle bg="false":
162169

163170
logs-anti-oracle:
164171
#!/usr/bin/env bash
165-
docker compose -f CD/anti-oracle/docker-compose.yaml logs -f
172+
docker compose -f CD/anti-oracle/docker-compose.yaml logs -ft

cli/nix/anti-agent-docker.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ in pkgs.dockerTools.buildImage {
1616
unpacked = pkgs.runCommand "unpack" {
1717
nativeBuildInputs = [ pkgs.gnutar pkgs.gzip ];
1818
} unpack;
19-
in [ unpacked pkgs.cacert ];
19+
in [ unpacked pkgs.docker pkgs.curl pkgs.coreutils pkgs.bash ];
2020
};
2121
}

cli/src/Cli.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module Cli
22
( cmd
33
, Command (..)
44
, WithValidation (..)
5+
, TokenInfoFailure (..)
56
) where
67

78
import Control.Monad.IO.Class (MonadIO (..))

cli/src/User/Agent/Options.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ module User.Agent.Options
77
, agentEmailPasswordOption
88
, daysOption
99
, testRunIdOption
10+
, registryOption
11+
, antithesisAuthOption
1012
) where
1113

1214
import Core.Options

0 commit comments

Comments
 (0)