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(prisma): Correct volume permissions #997

Merged
merged 3 commits into from
May 13, 2024
Merged

Conversation

akash1810
Copy link
Member

@akash1810 akash1810 commented May 13, 2024

Since #986 the Prisma migration task has been failing with:

download failed: s3://<REDACTED>/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'

That is, we're unable to download a file from S3 to a read-only path.

What does this change, and why?

This change:

  • Mounts the /usr/src/app/prisma volume in the container, as a writable location
  • Updates the container's entry point to download the artifact to this location

This results in the above error being resolved, and the migrations completing. Indeed the logs show this:

image

An additional change was made to better orchestrate the deployment order. See the inline comment for more detail.

How has it been verified?

The updated container was deployed to, and ran on, CODE. See the above screenshot for the logs.


Co-authored-by: @JuliaBrigitte
Co-authored-by: @NovemberTang

akash1810 and others added 3 commits May 13, 2024 14:02
Define the order of deployments for correctness.

Co-authored-by: Julia <[email protected]>
Co-authored-by: Natasha <[email protected]>
To increase determinism, use full file paths.

By not using relative paths, we remove the need for the working directory to be correct.

Co-authored-by: Julia <[email protected]>
Co-authored-by: Natasha <[email protected]>
Update AWS infrastructure, creating a volume at `/usr/src/app/prisma`,
and download the S3 artifact to this directory.

Co-authored-by: Julia <[email protected]>
Co-authored-by: Natasha <[email protected]>
@akash1810 akash1810 force-pushed the mob/prisma-prisma-prisma branch from ea0e405 to e3b7e59 Compare May 13, 2024 13:03
@akash1810 akash1810 changed the title use fully qualified paths fix(prisma): Correct volume permissions May 13, 2024
@akash1810 akash1810 marked this pull request as ready for review May 13, 2024 13:30
@akash1810 akash1810 requested review from a team as code owners May 13, 2024 13:30

COPY ./containers/prisma-migrate/run-prisma-migrate.sh ./run-prisma-migrate.sh
RUN chmod +x ./run-prisma-migrate.sh
COPY ./containers/prisma-migrate/run-prisma-migrate.sh /usr/src/app/run-prisma-migrate.sh
Copy link
Member Author

Choose a reason for hiding this comment

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

Using the full file path isn't strictly necessary as WORKDIR is set above. However, it makes it easier to understand exactly what is being done.

@akash1810 akash1810 merged commit 8649c60 into main May 13, 2024
3 checks passed
@akash1810 akash1810 deleted the mob/prisma-prisma-prisma branch May 13, 2024 13:33
const prismaVolume: Volume = {
name: 'prisma-volume',
const prismaArtifactVolume: Volume = {
name: 'artifact-volume',
Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed to "artifact" to distinguish this from the location the prisma binary is installed; "artifact" also matches the language used in other applications.

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.

2 participants