Skip to content

Commit

Permalink
Merge pull request #100 from WilhelmusLab/test-julia-dockerbuild
Browse files Browse the repository at this point in the history
Fix Julia compilation error when using IFT in a singularity container
  • Loading branch information
tdivoll authored Jan 22, 2024
2 parents 2927f54 + a3b5afd commit efda63a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
22 changes: 11 additions & 11 deletions config/cylc_hpc/flow_template_hpc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

[[pullfetchimage]]
# Pull the latest Docker image containing software for fetching images from NASA Worldview API and satellite times from space-track.org
# Singularity will check the image layers and only re-download if necessary
# Apptainer will check the image layers and only re-download if necessary
script = """
apptainer pull --force $project_dir/fetchdata.simg docker://brownccv/icefloetracker-fetchdata:main
"""
Expand All @@ -76,7 +76,7 @@
startdate_array=( $(echo $startdate | sed -e 's/,/ /g') )
enddate_array=( $(echo $enddate | sed -e 's/,/ /g') )

singularity exec --bind $fetchdata_dir/${location_array[$i]}:/tmp $project_dir/fetchdata.simg /usr/local/bin/fetchdata.sh -o /tmp -s ${startdate_array[$i]} -e ${enddate_array[$i]} -c $crs -b ${bbox_array[$i]}
apptainer exec --bind $fetchdata_dir/${location_array[$i]}:/tmp $project_dir/fetchdata.simg /usr/local/bin/fetchdata.sh -o /tmp -s ${startdate_array[$i]} -e ${enddate_array[$i]} -c $crs -b ${bbox_array[$i]}
"""
platform = oscar
execution time limit = PT1H
Expand All @@ -96,7 +96,7 @@
centroid_x_array=( $(echo $centroid_x| sed -e 's/,/ /g') )
centroid_y_array=( $(echo $centroid_y | sed -e 's/,/ /g') )

singularity exec --bind $results_dir/${location_array[$i]}/soit:/tmp $project_dir/fetchdata.simg python3 /usr/local/bin/pass_time_cylc.py --startdate ${startdate_array[$i]} --enddate ${enddate_array[$i]} --csvoutpath /tmp --centroid_x ${centroid_x_array[$i]} --centroid_y ${centroid_y_array[$i]} --SPACEUSER $SPACEUSER --SPACEPSWD $SPACEPSWD
apptainer exec --bind $results_dir/${location_array[$i]}/soit:/tmp $project_dir/fetchdata.simg python3 /usr/local/bin/pass_time_cylc.py --startdate ${startdate_array[$i]} --enddate ${enddate_array[$i]} --csvoutpath /tmp --centroid_x ${centroid_x_array[$i]} --centroid_y ${centroid_y_array[$i]} --SPACEUSER $SPACEUSER --SPACEPSWD $SPACEPSWD
"""
platform = oscar
execution time limit = PT1H
Expand All @@ -108,7 +108,7 @@

[[pulljuliaimage]]
# Pull the latest Docker image containing Julia IceFloeTracker software
# Singularity will check the image layers and only re-download if necessary
# apptainer will check the image layers and only re-download if necessary
script = """
apptainer pull --force $project_dir/icefloetracker-julia.simg docker://brownccv/icefloetracker-julia:main
"""
Expand All @@ -126,14 +126,14 @@
i=${CYLC_TASK_PARAM_param_set}
location_array=( $(echo $location | sed -e 's/,/ /g') )

singularity exec --bind $results_dir/${location_array[$i]}/landmasks:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl landmask $fetchdata_dir/${location_array[$i]} /tmp
apptainer exec --env JULIA_DEPOT_PATH=$HOME/.julia:/opt/julia --bind $results_dir/${location_array[$i]}/landmasks:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl landmask $fetchdata_dir/${location_array[$i]} /tmp
"""
platform = oscar
execution time limit = PT1H
submission retry delays = 2*PT30S
execution retry delays = PT6S
[[[directives]]]
--mem = 20G
--mem-per-cpu = 4G
--cpus-per-task = 8

[[preprocess<param_set>]]
Expand All @@ -142,14 +142,14 @@
i=${CYLC_TASK_PARAM_param_set}
location_array=( $(echo $location | sed -e 's/,/ /g') )

singularity exec --bind $results_dir/${location_array[$i]}/preprocess:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl preprocess -t $fetchdata_dir/${location_array[$i]}/truecolor -r $fetchdata_dir/${location_array[$i]}/reflectance -l $results_dir/${location_array[$i]}/landmasks -p $results_dir/${location_array[$i]}/soit -o /tmp
apptainer exec --env JULIA_DEPOT_PATH=$HOME/.julia:/opt/julia --bind $results_dir/${location_array[$i]}/preprocess:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl preprocess -t $fetchdata_dir/${location_array[$i]}/truecolor -r $fetchdata_dir/${location_array[$i]}/reflectance -l $results_dir/${location_array[$i]}/landmasks -p $results_dir/${location_array[$i]}/soit -o /tmp
"""
platform = oscar
execution time limit = PT1H
submission retry delays = 2*PT30S
execution retry delays = PT6S
[[[directives]]]
--mem = 70G
--mem-per-cpu = 12G
--cpus-per-task = 20

[[extractfeatures<param_set>]]
Expand All @@ -159,7 +159,7 @@
location_array=( $(echo $location | sed -e 's/,/ /g') )
preprocess_dir=$results_dir/${location_array[$i]}/preprocess

singularity exec --bind $preprocess_dir:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl extractfeatures -i $preprocess_dir -o /tmp --minarea $minfloearea --maxarea $maxfloearea
apptainer exec --env JULIA_DEPOT_PATH=$HOME/.julia:/opt/julia --bind $preprocess_dir:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl extractfeatures -i $preprocess_dir -o /tmp --minarea $minfloearea --maxarea $maxfloearea
"""
platform = oscar
execution time limit = PT1H
Expand All @@ -176,7 +176,7 @@
location_array=( $(echo $location | sed -e 's/,/ /g') )
preprocess_dir=$results_dir/${location_array[$i]}/preprocess

singularity exec --bind $results_dir/${location_array[$i]}/"tracker":/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl track --imgs $preprocess_dir --props $preprocess_dir --deltat $preprocess_dir --output /tmp
apptainer exec --env JULIA_DEPOT_PATH=$HOME/.julia:/opt/julia --bind $results_dir/${location_array[$i]}/"tracker":/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl track --imgs $preprocess_dir --props $preprocess_dir --deltat $preprocess_dir --output /tmp
"""
platform = oscar
execution time limit = PT1H
Expand All @@ -192,7 +192,7 @@
i=${CYLC_TASK_PARAM_param_set}
location_array=( $(echo $location | sed -e 's/,/ /g') )

singularity exec --bind $results_dir/${location_array[$i]}/preprocess:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl makeh5files --pathtosampleimg $fetchdata_dir/${location_array[$i]}/truecolor/$(ls $fetchdata_dir/${location_array[$i]}/truecolor | head -1) --resdir /tmp
apptainer exec --env JULIA_DEPOT_PATH=$HOME/.julia:/opt/julia --bind $results_dir/${location_array[$i]}/preprocess:/tmp,$report_dir:/usr/local/bin/../report $project_dir/icefloetracker-julia.simg $julia_exec -t auto /usr/local/bin/ice-floe-tracker.jl makeh5files --pathtosampleimg $fetchdata_dir/${location_array[$i]}/truecolor/$(ls $fetchdata_dir/${location_array[$i]}/truecolor | head -1) --resdir /tmp
"""
platform = oscar
execution time limit = PT1H
Expand Down
1 change: 0 additions & 1 deletion config/sample_site_locations.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
location,center_lat,center_lon,top_left_lat,top_left_lon,lower_right_lat,lower_right_lon,left_x,right_x,lower_y,top_y,startdate,enddate
bering_strait,65,-170,55.92827,-172.77869,74.25843,-163.83708,-3002871.001,-1502871.001,827477.2577,2327477.258,2020-09-04,2020-09-07
beaufort_sea,75,-135,67.22298,-152.46426,79.32881,-94.68433,-2383879.497,-883879.4975,-750000,750000,2020-09-05,2020-09-08
hudson_bay,60,-83,59.65687,-101.24295,57.54266,-66.04186,-2795941.755,-1295941.755,-3368686.029,-1868686.029,2020-09-06,2020-09-09
8 changes: 2 additions & 6 deletions workflow/scripts/pass_time_cylc.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,14 @@ def get_passtimes(
# pass, which means a daytime pass for Terra. These are the only passes of interest. If, furthermore, it's
# less than the current minimum distance between the overpass and the aoi, this is the new closest pass.
if not np.isnan(pass_dict["rise_lat"]):
if (pass_dict["rise_lat"] > pass_dict["over_lat"]) and (
pass_dict["distance"] < least_distance
):
if (pass_dict["rise_lat"] > pass_dict["over_lat"]) and (pass_dict["distance"] < least_distance):
least_distance = pass_dict["distance"]
closest_time = pass_dict["time"]

# For some edge case passes, rise latitude values are undefined. In this case, compare overpass latitude and
# set latitude values. If the overpass latitude is greater than the set latitude, it's a descending pass.
else:
if (pass_dict["set_lat"] < pass_dict["over_lat"]) and (
pass_dict["distance"] < least_distance
):
if (pass_dict["set_lat"] < pass_dict["over_lat"]) and (pass_dict["distance"] < least_distance):
least_distance = pass_dict["distance"]
closest_time = pass_dict["time"]

Expand Down

0 comments on commit efda63a

Please sign in to comment.