Skip to content

Commit 6a4c2c8

Browse files
committed
Add
1 parent 879902c commit 6a4c2c8

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/batchimages.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Base.@kwdef struct BatchImage
1717
image::String
1818
_cpu_image_key::Union{String, Nothing}
1919
_gpu_image_key::Union{String, Nothing}
20+
_image_tag::Union{String, Nothing}
21+
_image_sha::Union{String, Nothing}
2022
_is_product_default::Bool
2123
_interactive_product_name::Union{String, Nothing}
2224
end
@@ -34,6 +36,8 @@ function Base.show(io::IO, ::MIME"text/plain", image::BatchImage)
3436
print(io, '\n', " image: ", image.image)
3537
isnothing(image._cpu_image_key) || print(io, "\n CPU image: ", image._cpu_image_key)
3638
isnothing(image._gpu_image_key) || print(io, "\n GPU image: ", image._gpu_image_key)
39+
isnothing(image._image_tag) || print(io, ":$(image._image_tag)")
40+
isnothing(image._image_sha) || print(io, ":$(image._image_sha)")
3741
if !isnothing(image._interactive_product_name)
3842
print(io, "\n Features:")
3943
print(io, "\n - Expose Port: ✓")
@@ -214,6 +218,8 @@ Base.@kwdef mutable struct _ImageKeys
214218
isdefault::Bool = false
215219
cpu::Union{String, Nothing} = nothing
216220
gpu::Union{String, Nothing} = nothing
221+
tag::Union{String, Nothing} = nothing
222+
sha::Union{String, Nothing} = nothing
217223
end
218224

219225
function _group_images(images; image_group::AbstractString)
@@ -231,9 +237,11 @@ function _group_images(images; image_group::AbstractString)
231237
end
232238
image_key_name = _get_json(image, "image_key_name", String)
233239
display_name = _get_json(image, "display_name", String)
240+
tag = _get_json_or(image,"image_tag",String)
241+
sha = _get_json_or(image,"image_sha",String)
234242
image_type = _parse_image_group_entry_type(image)
235243
isnothing(image_type) && continue # invalid image type will return a nothing, which we will ignore
236-
imagekeys = get!(grouped_images, display_name, _ImageKeys(; isdefault=image_type.isdefault))
244+
imagekeys = get!(grouped_images, display_name, _ImageKeys(; isdefault=image_type.isdefault, tag, sha))
237245
# If this image key set is already problematic, no point in checking further
238246
imagekeys.error && continue
239247
# We make sure that there are no conflicts with base- and option- image types
@@ -333,6 +341,8 @@ function _batchimages_62(auth::Authentication)
333341
_gpu_image_key = imagekey.gpu,
334342
_is_product_default = imagekey.isdefault,
335343
_interactive_product_name = interactive_product_name,
344+
_image_tag = imagekey.tag,
345+
_image_sha = imagekey.sha,
336346
)
337347
end
338348
end

src/jobsubmission.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ struct _JobSubmission1
2222
# Job image configuration
2323
product_name::Union{String, Nothing}
2424
image::Union{String, Nothing}
25+
image_tag::Union{String, Nothing}
2526
image_sha256::Union{String, Nothing}
2627
sysimage_build::Union{String, Nothing}
2728
sysimage_manifest_sha::Union{String, Nothing}
@@ -56,6 +57,7 @@ struct _JobSubmission1
5657
# Job image configuration
5758
product_name::Union{AbstractString, Nothing}=nothing,
5859
image::Union{AbstractString, Nothing}=nothing,
60+
image_tag::Union{AbstractString, Nothing}=nothing,
5961
image_sha256::Union{AbstractString, Nothing}=nothing,
6062
sysimage_build::Union{Bool, Nothing}=nothing,
6163
sysimage_manifest_sha::Union{AbstractString, Nothing}=nothing,
@@ -138,7 +140,7 @@ struct _JobSubmission1
138140
appbundle, appbundle_upload_info,
139141
registry_name, package_name, branch_name, git_revision,
140142
# Job image configuration
141-
product_name, image, image_sha256, string(sysimage_build), sysimage_manifest_sha,
143+
product_name, image, image_tag, image_sha256, string(sysimage_build), sysimage_manifest_sha,
142144
# Compute configuration
143145
node_class, string(cpu),
144146
string(nworkers), _string_or_nothing(elastic), _string_or_nothing(min_workers_required),
@@ -1311,7 +1313,12 @@ function _job_submit_args(
13111313
end
13121314
batch.image._cpu_image_key
13131315
end
1314-
(; product_name=batch.image.product, image)
1316+
(;
1317+
product_name=batch.image.product,
1318+
image,
1319+
image_tag=batch.image._image_tag,
1320+
image_sha256=batch.image._image_sha
1321+
)
13151322
else
13161323
(;)
13171324
end

0 commit comments

Comments
 (0)