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

Add Container Patch URLS at build time #227

Closed
wants to merge 2 commits into from
Closed

Add Container Patch URLS at build time #227

wants to merge 2 commits into from

Conversation

OrangeDrangon
Copy link

@OrangeDrangon OrangeDrangon commented Jul 2, 2021

🗣 Description

Adds apply_patches.sh to keep the Dockerfile from growing too complex.
Can be used in entrypoint.sh as well I imagine.

Changes the optional build step to write a status.txt out. Later use that file to
know whether or not foundry was installed. I was unable to
find a way to detect this built into to Docker and multistage builds do
not persist environment variables across them. I am very open to other options.
Then read back the file to determine whether or not to run the Container
Patch URLs then remove it..

Container Patch URLs must be ran in the second stage because they may
rely on the /data directory existing and what not. Running in the
second step guarantees the same runtime environment they normally expect.

💭 Motivation and Context

See Issue #220

🧪 Testing

Built an image with various permutations of having and not having patch urls and credentials. Build ran successfully in all cases.

✅ Checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow project standards.
  • All relevant repo and/or project documentation has been updated to reflect
    the changes in this PR.
  • Tests have been added to cover the changes in this PR.
  • All new and existing tests pass.

@OrangeDrangon
Copy link
Author

OrangeDrangon commented Jul 2, 2021

Not really sure if I did everything correctly. Sorry if there is any of the commit process wrong. I am of course open to any feedback or changes needed to get this merged.

@hugoprudente
Copy link
Contributor

As a user I really enjoy this change, as I use my containers pre-built having the hability of using the patch_urls during my setup is awesome.

Can't wait to have this merged. Tested here and worked as a charm!

@hugoprudente
Copy link
Contributor

Hi @OrangeDrangon if this PR is ready, can you mark it as Ready for Review so we can review it?

@OrangeDrangon
Copy link
Author

@felddy I am not sure how to proceed with the error of logging.sh not being found. It works in my tests. I think the linter is confused.

Adds apply_patches.sh to keep the Dockerfile from growing too complex.
Can be used in `entrypoint.sh` as well I imagine.

Changes the optional build step to write a `status.txt` out. Later use that file to
know whether or not foundry was installed. I was unable to
find a way to detect this built into to Docker and multistage builds do
not persist environment variables across them. I am very open to other options.
Then read back the file to determine whether or not to run the Container
Patch URLs then remove it..

Container Patch URLs must be ran in the second stage because they may
rely on the `/data` directory existing and what not. Running in the
second step guarantees the same runtime environment they normally expect.
@OrangeDrangon OrangeDrangon marked this pull request as ready for review June 1, 2022 02:13
@OrangeDrangon OrangeDrangon requested a review from felddy as a code owner June 1, 2022 02:13
src/apply_patches.sh Outdated Show resolved Hide resolved

RUN \
if [[ $(cat status.txt) = "installed" ]]; then \
source ./apply_patches.sh; \
Copy link
Contributor

Choose a reason for hiding this comment

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

We may want to remove the ./ from here too, just to be consistent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please also rebase your change as it's outdated with target branch as per This branch is out-of-date with the base branch

Copy link
Author

Choose a reason for hiding this comment

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

Will do sometime soon.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants