Resolve "Setup gitlab-ci"
changed milestone to %SoAR-2023W07
added Partner::NOC Status::In Progress Weight::2 labels
added 1 commit
- 313f5674 - refactor: closing files that have been opened
After pulling the image:
kirk@NOCS05411V:~$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e2e69aa0f452 registry.c2.noc.ac.uk/backbone-message-format:12-setup-gitlab-ci "sleep infinity" 5 seconds ago Up 5 seconds amazing_gagarin kirk@NOCS05411V:~$ docker exec -it amazing_gagarin /bin/bash OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown kirk@NOCS05411V:~$ ls education misc private.key repos kirk@NOCS05411V:~$ docker exec -it amazing_gagarin /bin/sh /app # ls CONTRIBUTING.md __init__.py formats requirements-dev.txt tests LICENSE docker generate_schema_config.py requirements.txt README.md examples project run-compose.sh
- Last updated by Trishna Saeharaseelan
74 76 75 77 swag = Swagger(app, config=swagger_config, merge=True) 76 78 79 flask_host = os.getenv( 80 "FLASK_HOST", "localhost" 81 ) # Sets to whatever MQ_HOST is, or defaults to localhost 77 82 78 83 if __name__ == "__main__": 79 app.run(debug=True) 84 app.run(debug=False, host=flask_host) Tbh I copied what I'd done with https://git.noc.ac.uk/communications-backbone-system/communications-backbone/-/blob/dev/api.py#L39. The debug=True option basically provides a URL to go to that lets you get into the nitty gritty of what's going on and isn't suitable for a production environment. I think in the future we can add it as a toggle maybe (or happy to do that on both for now if that's the call!) but for now I was just leaving it as False to prevent it going live with that
- Last updated by Trishna Saeharaseelan
1 FROM python:3.9.16-alpine Ah, I'm guessing you'll be updating the comms-backbone repo to this :)
Nope! The
-alpine
is important here. The comms-backbone base image is a larger sized one with more stuff installed in it - some of those dependencies we need in the comms-backbone but not here, so I used a lightweight version of the imageWe could use the alpine image in the comms-backbone and install these reqs ourselves (I've left a comment just under where you linked to saying what they are!), but I found that actually it was nicer and quicker to just use the better base image (although could probably test the "quicker" claim a bit more)
mentioned in commit fce7b4a8