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 buildscript creation for createDockerfile #277

Merged
merged 3 commits into from
Nov 27, 2024

Conversation

rem1776
Copy link
Contributor

@rem1776 rem1776 commented Nov 26, 2024

Describe your changes

Updates the createDockerfile fremake subcommand to create a short container build script instead of running commands directly.

I also added another level of indents so it'll only create the build script/run if the if iscontainer conditional is true like the commands above it. I think it needs the commands above it for the build script to work properly, but I don't really know how multiplatform builds work so let me know if it should be moved back.

This needs #271 in first, which adds the same functionality to run-fremake with container builds.

Issue ticket number and link (if applicable)

Checklist before requesting a review

  • I ran my code
  • I tried to make my code readable
  • I tried to comment my code
  • I wrote a new test, if applicable
  • I wrote new instructions/documentation, if applicable
  • I ran pytest and inspected it's output
  • I ran pylint and attempted to implement some of it's feedback

@rem1776 rem1776 marked this pull request as ready for review November 27, 2024 17:44
else:
sys.exit()
# create build script for container
dockerBuild.createBuildScript(containerBuild, containerRun)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm ok, I thought this looked ok but for some reason I'm seeing this when testing:

AttributeError: 'container' object has no attribute 'createBuildScript'

Copy link
Collaborator

@singhd789 singhd789 Nov 27, 2024

Choose a reason for hiding this comment

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

WAIT, I think I just forgot to install the recent changes in my conda environment


# run the script if option is given
if run:
subprocess.run(args=[dockerBuild.userScriptPath], check=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just need to import subprocess on the top!

@singhd789 singhd789 merged commit eaa05ed into NOAA-GFDL:main Nov 27, 2024
2 checks passed
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