Update README for corporate macbook - #1967
Conversation
| Create and activate the environment: | ||
|
|
||
| ``` shell | ||
| conda env create -f environment.yml |
There was a problem hiding this comment.
This command has the -n attribute missing?
conda create -n eq-questionnaire-runner -f environment.yml
There was a problem hiding this comment.
environment.yml sets name: eq-runner, no -n is not needed here
| eval "$(pyenv init -)" | ||
| #### Poetry | ||
|
|
||
| Poetry must install into the conda environment rather than creating its own virtualenv. |
There was a problem hiding this comment.
Maybe some mention how to install poetry? Since we explain how to install everything else?
There was a problem hiding this comment.
Sure, poetry comes via environment.yml so there is no separate install step but you are right, I will adjust to make it explicit
| ``` shell | ||
| curl -sSL https://install.python-poetry.org | python3 - --version 2.1.2 | ||
| poetry self add poetry-plugin-dotenv | ||
| poetry install |
There was a problem hiding this comment.
Maybe something about poetry update?
| - Miniconda: Python, node and system package management (install from Self Service) | ||
| - Podman: Container runtime for supporting services (machine created and running) | ||
| - wkhtmltopdf: PDF generation (installed separately, see below) | ||
| - gcloud: Pulling images from Google Artifact Registry |
There was a problem hiding this comment.
It's not in Self Service as a package so we should mention it should be installed from source?
There was a problem hiding this comment.
Yes, I got it confused. Will add that
| podman machine start | ||
| ``` | ||
|
|
||
| `wkhtmltopdf` is nor reliably available on conda-forge for macOS ARM, so it is installed outside the conda environment. |
There was a problem hiding this comment.
Thanks for catching that! Fixed!
| ``` | ||
|
|
||
| On MacOS install container runtimes, eg. [Colima](https://github.com/abiosoft/colima): | ||
| Podman is API-compatible with Docker, so provide a `docker` command that points at it. This is still needed for the plain `docker run` commands used later in this README (e.g. running launcher, SDS, CIR images): |
There was a problem hiding this comment.
Any need for alias docker=podman anymore in .zshrc? Or would it only confuse us?
There was a problem hiding this comment.
I dont think we need it as we went for this option in the drop-in discussion: Change the Makefile to docker-compose. No per-machine setup, but this fixes only compose commands and docker build target would still need the symlink
There was a problem hiding this comment.
My vote would be for adding this as an alias but happy to go with the flow on this. I forgot we discussed this originally as a team 🫣
There was a problem hiding this comment.
Sure, lets agree on adding it as an alias and we can review this in a couple of months time
661921c to
97cbe1c
Compare
liamtoozer
left a comment
There was a problem hiding this comment.
Great work 👍 Able to spin up Runner and is working great 🙌 Just some really minor questions/comments
| docker compose -f docker-compose-dev.yml pull sds | ||
| docker compose -f docker-compose-dev.yml pull cir | ||
| docker compose -f docker-compose-dev.yml up -d | ||
| docker-compose -f docker-compose-dev.yml pull eq-questionnaire-launcher |
There was a problem hiding this comment.
I might be wrong but I've noticed it worked without the hyphens here. podman compose and docker compose both seem to work okay for me 🤔
I've noticed a few teams have set a condition at the top of their Makefile to handle docker/podman mappings, so this might be enough here? For example: https://github.com/ONSdigital/census31-rm-fieldwork-adapter/blob/be5f9531848f6e751323b62822defee25c02cd82/Makefile#L2
There was a problem hiding this comment.
Yes, so both forms should work if you have the docker -> podman symlink. This was the option we picked at the drop-in session. The conditional approach in census31 team looks like a good alternative as well, happy to have a follow-up with the team to pick which solution we should go ahead with
There was a problem hiding this comment.
After discussion, have implemented census31 team conditional approach
| docker --version | ||
| ``` | ||
|
|
||
| The Makefile and the commands below use the standalone `docker-compose` binary (not the |
There was a problem hiding this comment.
I might be wrong with this again, but we might not need to do this, as per this comment: https://github.com/ONSdigital/eq-questionnaire-runner/pull/1967/changes#r3948509228
| @@ -11,27 +11,46 @@ | |||
|
|
|||
| ## Run with Docker | |||
There was a problem hiding this comment.
Very minor - does this section name need to change if we're using Podman?
|
|
||
| ```shell | ||
| colima start | ||
| docker --version |
There was a problem hiding this comment.
One small thing I wondered about here: This will return something likedocker version 5.8.4, but that’s actually reflecting the Podman version rather than a real Docker install. Not sure what is the best for this and open to suggestions, but I would probably vote for alias docker='podman' in shell profile?
|
|
||
| ``` shell | ||
| RUNNER_ENV_FILE=.development.env docker compose up -d | ||
| RUNNER_ENV_FILE=.development.env docker-compose up -d |
There was a problem hiding this comment.
Hyphen might not be needed here and in the other places?
| Set this on the environment so that no configuration file is left in the repository: | ||
|
|
||
| ``` shell | ||
| conda env config vars set POETRY_VIRTUALENVS_CREATE=false |
There was a problem hiding this comment.
Just wondered if this could be instead set in the environment.yml file in the variables: block?
There was a problem hiding this comment.
Yes! I dont know why I didnt think of that. Yes, that should be possible
What is the context of this PR?
Homebrew is no longer available on Corporate MacBooks, so the README's local setup instructions no longer work. This reworks them to use Miniconda + conda-forge for packages and Podman as the container runtime, replacing
brew,pyenv,nvmand ColimaReflects the decisions from the drop-in session: closest-patch Node pinning,
environment.ymlcommitted, Makefile usesdocker-composeWhat has changed?
environment.yml: added and committed, pinning Python, Node, Poetry, snappy, jq, setting poetry env to falseMakefile: conditional approach from census31 team implemented to detect container runtime automaticallypyproject.toml/poetry.lock: addedpython-dotenvas an explicit dependency.gitignore: un-ignoresenvironment.ymlVerified end to end on a Corporate MacBook: runner, launcher and datastore all running, survey launches and completes.
How to review
22.13.0→22.17.0), so.nvmrc'sv22.15.0isn't available. Pinned to22.13.0per the agreed ruledocker-composebinaryRetrace the new steps on a corporate Macbook and confirm the setup works from a clean start.