Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing auto migrate #990

Closed
wants to merge 17 commits into from
Closed

Conversation

JuliaBrigitte
Copy link
Contributor

@JuliaBrigitte JuliaBrigitte commented May 9, 2024

What does this change?

Changes to path to /usr/src/app/prisma as the one that is readonly false

Why?

automatic migration failed with the following message
download failed: s3://deploy-tools-dist/deploy/CODE/service-catalogue-prisma-migrations/prisma.zip to prisma/prisma.zip Could not create directory /usr/src/app/prisma: [Errno 30] Read-only file system: '/usr/src/app/prisma'

Why was this difficult to diagnose

./run-prisma-migrate.sh: line 15: prisma/node_modules/.bin/prisma: not found
seemed pretty obvious to fix but no matter what I changed in run-prisma-migrate.sh nothing made a difference.
Until I became convinced my changes did not take effect and changed the messages on the log and sure enough, they did not change.
But then I found #865
So it seems a new image is created but not used:
"
At the moment, each image gets pushed to GHCR tagged with the full commit sha, e.g.

ghcr.io/guardian/service-catalogue/prisma-migrate:sha-42771e43c3130daa7476d9e5b77455001533c557

This will be manually referenced within the CDK, when the task definition that uses this image is defined.
"
This seems non obvious.

How do we make it better, at the very least I would expect some mention in the READMEs and a comment in the run-prisma_migrate.sh about the need to manually reference a new image.

@JuliaBrigitte JuliaBrigitte requested review from a team as code owners May 9, 2024 16:03
@JuliaBrigitte
Copy link
Contributor Author

Ashleigh Carr, 21 min

Thats right yea. You need to update the image version here

prismaMigrate: ContainerImage.fromRegistry(
'ghcr.io/guardian/service-catalogue/prisma-migrate:stable',
),
to point to the image built in CI

Akash Askoolum, 20 min

That's quite the long feedback loop! Are we able to shorten it by running the container locally?

You, 18 min

We do not run migrations locally at the moment but Ash has a PR about it I think.

Akash Askoolum, 14 min
, Edited
Due to some synchronisation issues, I don't think we'd be able to use the container to perform migrations in dev as part of the standard dev-environment, currently.

It might be possible, however, to run the prisma container ad-hoc against a new postgres database, as a way of testing changes quickly (vs pushing, waiting for CI, and deploying to CODE).

You, 13 min

From what I understand you would have to deploy, then change to the new image and then deploy again.

Akash Askoolum, 11 min

Indeed. That's quite a long feedback loop!

@@ -1,4 +1,6 @@
#!/bin/ash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is bin/ash a valid shell?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ash is the default shell of in alpine linux - https://en.wikipedia.org/wiki/Almquist_shell.

@JuliaBrigitte
Copy link
Contributor Author

Solved in new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants