-
Notifications
You must be signed in to change notification settings - Fork 15
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 --execute option to run-fremake #271
Conversation
run the container; apptainer or singularity used | ||
""" | ||
os.system(containerBuild+" build -f Dockerfile -t "+self.e+":"+self.target.gettargetName()) | ||
os.system("rm -f "+self.e+".tar "+self.e+".sif") | ||
os.system(containerBuild+" save -o "+self.e+"-"+self.target.gettargetName()+".tar localhost/"+self.e+":"+self.target.gettargetName()) | ||
os.system(containerRun+" build --disable-cache "+self.e+"-"+self.target.gettargetName()+".sif docker-archive://"+self.e+"-"+self.target.gettargetName()+".tar") | ||
|
||
def createBuildScript(self,containerBuild,containerRun): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea, thanks for this! Takes a little bit more of the magic of how to build the actual container away. 🎉 Maybe we should actually make the creation of this script a default behavior in def build
. (basically replacing def build
with def createBuildScript
)
Then in runFremake.py
, instead of
if execute:
dockerBuild.build(containerBuild,containerRun)
else:
dockerBuild.createBuildScript(containerBuild, containerRun)
print("Container build script created at "+dockerBuild.userScriptPath+"\n\n")
It would be:
#create the container build script
dockerBuild.createBuildScript(containerBuild, containerRun)
#print statement
(ADD print statement somewhere about where the script is located)
if execute:
subprocess.run(args=[dockerBuild.userScriptPath], check=True)
else:
print("Container build script created at "+dockerBuild.userScriptPath+"\n\n")
What do you think? Or do you think it might be better to have one less script being made if it doesn't need to be (i.e. if execute is passed, no need to make the build script)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think always making the script is a good idea just cause it'll be a little more transparent and easier to debug build issues. I'll add those changes in!
This is looking good! Do you think we can also add print statements for where the checkout and Makefile files are too? I think for checkout, we could put this on line 91 of
Then for the makefile, output around line 131 of
|
Describe your changes
Changes run-fremake to work more like bronx's fremake and require a
-e
/--execute
flag to run build scripts.If the
--execute
option is given, it'll work as it does currently without the flag and run the compile script/docker build command after it is created. If its not given, it'll print out a compile script path for the user to run.Since container builds don't have a build script currently this also adds code to write out a short script with the container commands to build and transfer the format.
Issue ticket number and link (if applicable)
Checklist before requesting a review