From getting barge going, here's how it calls specific pdr-backend components and passes arguments.
- user calls /barge/start_ocean.sh to get barge going
-
it fills
COMPOSE_FILES
egCOMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-publisher.yml"
barge/compose-files/pdr-publisher.yml
sets:pdr-publisher: image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest}
pdr-publisher: command: publisher
pdr-publisher: networks: backend: ipv4_address: 172.15.0.43 (change this?)
pdr-publisher: environment:
RPC_URL: ${NETWORK_RPC_URL}
ADDRESS_FILE: /root/.ocean/ocean-contracts/artifacts/address.json
- (many
PRIVATE_KEY_*
)
-
then it pulls the
$COMPOSE_FILES
as needed:[ ${FORCEPULL} = "true" ] && eval docker-compose "$DOCKER_COMPOSE_EXTRA_OPTS" --project-name=$PROJECT_NAME "$COMPOSE_FILES" pull
-
then it runs docker-compose including all
$COMPOSE_FILES
:eval docker-compose "$DOCKER_COMPOSE_EXTRA_OPTS" --project-name=$PROJECT_NAME "$COMPOSE_FILES" up --remove-orphans
- it executes each of the
"command"
entries in compose files.- (Eg for pdr-publisher.yml, its
"command" = "publisher"
) - (or we could have eg
"command" = "publisher ppss.yaml development"
) - Which then goes to
pdr-backend/entrypoint.sh
via"python /app/pdr_backend/pdr $@"
- (where
@
is unpacked as egpublisher
) Ref. - (or
@
is unpacked as egpublisher ppss.yaml development
)
- (where
- (Eg for pdr-publisher.yml, its
- Then it goes through the usual CLI at
pdr-backend/pdr_backend/util/cli_module.py
-
If you made a change to pdr-backend CLI interface, then barge must call using the updated CLI command.
How:
- change the relevant compose file's
"command"
. Eg changebarge/compose-files/pdr-publisher.yml
's "command" value topublisher ppss.yaml development
- also, change envvar setup as needed. Eg in compose file, remove
RPC_URL
andADDRESS_FILE
entry. - ultimately, ask: "does Docker have everything it needs to succesfully run the component?"