NBISweden / ejprd

1 stars 0 forks source link

Add instructions for storage and interfaces in demo mode #6

Closed MalinAhlberg closed 8 months ago

MalinAhlberg commented 8 months ago

This is a start on solving #2, by adding instructions for part 2a.

wna-se commented 8 months ago

Jag får ett felmeddelande när jag kör compose -f docker-compose-demo.yml up -d

service "s3inbox" can't be used with extends as it declare depends_on

Jag använder Docker Compose version v2.24.6 med Podman 4.9.3

dbampalikis commented 8 months ago

@wna-se there is a fix for that in version 2.25.0 of docker compose which is available now. Could you give it a try with that?

wna-se commented 8 months ago

Managed to get past the compose command but it seems the rabbitmq container runs into some issues. After some delay to let the containers get started, I get the following message in the terminal where I ran the compose command:

dependency failed to start: container rabbitmq is unhealthy

Logs from rabbitmq: rabbitmq.log.txt

dbampalikis commented 8 months ago

I guess we need to add that to the documentation, could you try running

docker compose -f docker-compose-demo.yml down -v --remove-orphans

and then user the up command again? In general the demo need this every time you want to run it, due to the way the credential scripts are run

wna-se commented 8 months ago

I managed to get it running by changing some of the configurations and disabling some of the health checks. A summary of my “hacks” in hopes of finding better solutions. Also, is there a particular reason for using the host network?

rabbitmq

Need to run as user rabbitmq to avoid the permission related issue from my first comment and the health check always fails for some reason (running the same command in the container itself using compose exec rabbitmq is successful). I also named the volume defined in the rabbitmq base Docker file.

Edit: Seems like reformatting the value for healthcheck test solves the problem for Podman, e.g. test: rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms

services:
  rabbitmq:
    extends:
      file: docker-compose.yml
      service: rabbitmq
    volumes:
      - rabbitmq:/var/lib/rabbitmq
    user: rabbitmq
    healthcheck:
      test: rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms

volumes:
  rabbitmq:

s3inbox, download, oidc

Removed the extra_hosts section relying on the host-gateway keyword since it’s not available in Podman and instead set the environment variable DOCKERHOST=host.containers.internal to access the host network directly. I made the changes in the docker-compose.yml file since I didn’t find a way to override it in the docker-compose-demo.yml.

oidc

Health check always fails for some reason (running the same command in the container itself using compose exec oidc is successful), e.g. test: [ "CMD", "sh", "-c", "true" ].

Edit: Seems like reformatting the value for healthcheck test solves the problem for Podman, e.g. test: python3 -c 'import requests; print(requests.get(url = "https://localhost:8080/jwk", verify="/shared/cert/ca.crt").text)'

MalinAhlberg commented 8 months ago

Great that you could get everything running, @wna-se ! The extra_hosts is for allowing communication with other gdi compontens, such as lsaai and htsget (see eg here) that are not started from the same compose file. It would be great with the docker compose diff added here, as we discussed, for future reference.

wna-se commented 8 months ago

Great that you could get everything running, @wna-se ! The extra_hosts is for allowing communication with other gdi compontens, such as lsaai and htsget (see eg here) that are not started from the same compose file. It would be great with the docker compose diff added here, as we discussed, for future reference.

I’ve attached a patch file for the docker-compose.yml and docker-compose-demo.yml files and created a fork where it’s been applied.

I can see the reasoning. To allow some more flexibility in how to extend the configuration it might be useful not to rely on the extra_hosts key in the base configuration since it can’t be overridden. I think that it would also make sense to publish an image with an LS-AAI mock service and use depends_on or a network explicitly configured to expose the services required.