Skip to content

Commit

Permalink
Merge pull request #1236 from input-output-hk/chore/LW-10311-smash-cf…
Browse files Browse the repository at this point in the history
…g-cleanup

Add pool-delist-schedule and pool-rewards queues to deployed pg-boss-worker
  • Loading branch information
iccicci committed May 6, 2024
2 parents 692624e + f47db74 commit e7867d3
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 29 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ WORKDIR /app/packages/cardano-services
CMD ["node", "dist/cjs/cli.js", "start-blockfrost-worker"]

FROM cardano-services as pg-boss-worker
WORKDIR /config
COPY compose/schedules.json .
ENV SCHEDULES=/config/schedules.json
WORKDIR /app/packages/cardano-services
CMD ["node", "dist/cjs/cli.js", "start-pg-boss-worker"]

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
env = utils.mkPodEnv ({
NETWORK = config.network;
LOGGER_MIN_SEVERITY = values.cardano-services.loggingLevel;
QUEUES = "pool-metadata,pool-metrics";
QUEUES = "pool-delist-schedule,pool-metadata,pool-metrics,pool-rewards";
STAKE_POOL_PROVIDER_URL = "http://${chart.name}-backend.${chart.namespace}.svc.cluster.local";
BUILD_INFO = values.cardano-services.buildInfo;

Expand Down
15 changes: 15 additions & 0 deletions nix/cardano-services/oci-images.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@ let
path = self.outPath;
};
};

setupSchedules =
std.lib.ops.mkSetup "schedules" [
{
regex = ".*";
mode = "0444";
}
] ''
mkdir -p $out/config
cp ${self}/compose/schedules.json $out/config/schedules.json
'';
in {
cardano-services = std.lib.ops.mkStandardOCI {
name = "926093910549.dkr.ecr.us-east-1.amazonaws.com/cardano-services";
operable = cell.operables.cardano-services;
config.Env = [
"SCHEDULES=/config/schedules.json"
];
setup = [setupSchedules];
meta.description = "Minimal Cardano Services OCI Image";
meta.versions = builtins.fromJSON (builtins.readFile (self + /packages/cardano-services-client/supportedVersions.json));
meta.buildInfo = buildInfo;
Expand Down
Empty file.
Empty file.
4 changes: 0 additions & 4 deletions packages/cardano-services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ services:
volumes:
- ./config/network/${NETWORK:-mainnet}:/config

pg-boss-worker:
volumes:
- ./environments/.schedules.json:/config/schedules.json

cardano-submit-api:
volumes:
- ./config/network/${NETWORK:-mainnet}:/config
Expand Down
2 changes: 0 additions & 2 deletions packages/cardano-services/environments/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
METADATA_FETCH_MODE="smash"
SMASH_URL="http://cardano-smash:3100/api/v1"
SCHEDULES="/config/schedules.json"
2 changes: 0 additions & 2 deletions packages/cardano-services/environments/.env.mainnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
METADATA_FETCH_MODE="smash"
SMASH_URL="https://smash.cardano-mainnet.iohk.io/api/v1"
SCHEDULES="/config/schedules.json"
TOKEN_METADATA_SERVER_URL="https://tokens.cardano.org"
3 changes: 1 addition & 2 deletions packages/cardano-services/environments/.env.preprod
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
OGMIOS_PORT=${OGMIOS_PORT:-1339}
METADATA_FETCH_MODE="smash"
SCHEDULES="/config/schedules.json"
SMASH_URL="https://preprod-smash.world.dev.cardano.org/api/v1"
3 changes: 1 addition & 2 deletions packages/cardano-services/environments/.env.preview
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
HANDLE_POLICY_IDS=${HANDLE_POLICY_IDS:-f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a}
OGMIOS_PORT=${OGMIOS_PORT:-1340}
METADATA_FETCH_MODE="smash"
SCHEDULES="/config/schedules.json"
SMASH_URL="https://preview-smash.world.dev.cardano.org/api/v1"
4 changes: 2 additions & 2 deletions packages/cardano-services/test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ describe('CLI', () => {

describe('schedules', () => {
testPgBoss('accepts a valid schedule file', 'pgboss', {
args: ['--schedules', 'environments/schedules.json'],
env: { SCHEDULES: 'environments/schedules.json' },
args: ['--schedules', '../../compose/schedules.json'],
env: { SCHEDULES: '../../compose/schedules.json' },
expectedArgs: {
args: { schedules: [{ cron: '0 * * * *', queue: 'pool-delist-schedule', scheduleOptions: {} }] }
}
Expand Down
4 changes: 0 additions & 4 deletions packages/e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ services:
volumes:
- ./local-network/config/network:/config

pg-boss-worker:
volumes:
- ./schedules.json:/config/schedules.json

cardano-submit-api:
depends_on:
local-testnet:
Expand Down
10 changes: 0 additions & 10 deletions packages/e2e/schedules.json

This file was deleted.

0 comments on commit e7867d3

Please sign in to comment.