Skip to content

Commit

Permalink
Merge branch 'main' into 204-improve-fre-cmor-run-functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ilaflott committed Oct 28, 2024
2 parents f190f50 + 65fc0c2 commit b84ac63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion fre/make/gfdlfremake/buildBaremetal.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def writeScript(self):
self.f.write(self.make+"\n")
self.f.close()

# Make compile script executable
os.chmod(self.bld+"/compile.sh", 0o744)

## TODO run as a batch job on the login cluster
def run(self):
"""
Expand All @@ -118,7 +121,6 @@ def run(self):
- self : The dockerfile object
"""
###### TODO make the Makefile
os.chmod(self.bld+"/compile.sh", 0o744)
command = [self.bld+"/compile.sh","|","tee",self.bld+"/log.compile"]
try:
subprocess.run(args=command, check=True)
Expand Down
2 changes: 1 addition & 1 deletion fre/make/gfdlfremake/buildDocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def writeRunscript(self,RUNenv,containerRun,runOnDisk):
"""
#create runscript in tmp - create spack environment, install necessary packages,
self.createscript = ["#!/bin/bash \n",
"export BACKUP_LD_LIBRARY_PATH=$LD_LIBRARY\n",
"export BACKUP_LD_LIBRARY_PATH=$LD_LIBRARY_PATH\n",
"# Set up spack loads\n",
RUNenv[0]+"\n"]
with open(runOnDisk,"w") as f:
Expand Down
4 changes: 3 additions & 1 deletion fre/make/gfdlfremake/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ def finish (self,pc):
else:
self.checkoutScript.close()

# Make checkout script executable
os.chmod(self.src+"/"+self.fname, 0o744)

## TODO: batch script building
def run (self):
"""
Brief: Changes the permission on the checkout script and runs it
Param:
- self The checkout script object
"""
os.chmod(self.src+"/"+self.fname, 0o744)
try:
subprocess.run(args=[self.src+"/"+self.fname], check=True)
except:
Expand Down

0 comments on commit b84ac63

Please sign in to comment.