|
| 1 | +// SPDX-FileCopyrightText: Copyright (C) SchedMD LLC. |
| 2 | +// SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +################################################################################ |
| 5 | + |
| 6 | +variable "REGISTRY" { |
| 7 | + default = "ghcr.io/slinkyproject" |
| 8 | +} |
| 9 | + |
| 10 | +variable "VERSION" { |
| 11 | + default = "0.0.0" |
| 12 | +} |
| 13 | + |
| 14 | +function "format_tag" { |
| 15 | + params = [registry, stage, version] |
| 16 | + result = format("%s:%s", join("/", compact([registry, stage])), join("-", compact([version]))) |
| 17 | +} |
| 18 | + |
| 19 | +################################################################################ |
| 20 | + |
| 21 | +target "_common" { |
| 22 | + labels = { |
| 23 | + # Ref: https://github.com/opencontainers/image-spec/blob/v1.0/annotations.md |
| 24 | + "org.opencontainers.image.authors " = "[email protected]" |
| 25 | + "org.opencontainers.image.documentation" = "https://github.com/SlinkyProject/slurm-operator" |
| 26 | + "org.opencontainers.image.license" = "Apache-2.0" |
| 27 | + "org.opencontainers.image.vendor" = "SchedMD LLC." |
| 28 | + "org.opencontainers.image.version" = "${VERSION}" |
| 29 | + "org.opencontainers.image.source" = "https://github.com/SlinkyProject/slurm-operator" |
| 30 | + # Ref: https://docs.redhat.com/en/documentation/red_hat_software_certification/2025/html/red_hat_openshift_software_certification_policy_guide/assembly-requirements-for-container-images_openshift-sw-cert-policy-introduction#con-image-metadata-requirements_openshift-sw-cert-policy-container-images |
| 31 | + "vendor" = "SchedMD LLC." |
| 32 | + "version" = "${VERSION}" |
| 33 | + "release" = "https://github.com/SlinkyProject/slurm-operator" |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +################################################################################ |
| 38 | + |
| 39 | +group "default" { |
| 40 | + targets = [ |
| 41 | + "operator", |
| 42 | + "webhook", |
| 43 | + ] |
| 44 | +} |
| 45 | + |
| 46 | +################################################################################ |
| 47 | + |
| 48 | +target "operator" { |
| 49 | + inherits = ["_common"] |
| 50 | + dockerfile = "build/Dockerfile.operator" |
| 51 | + labels = { |
| 52 | + # Ref: https://github.com/opencontainers/image-spec/blob/v1.0/annotations.md |
| 53 | + "org.opencontainers.image.title" = "Slurm Operator" |
| 54 | + "org.opencontainers.image.description" = "Kubernetes Operator for Slurm" |
| 55 | + # Ref: https://docs.redhat.com/en/documentation/red_hat_software_certification/2025/html/red_hat_openshift_software_certification_policy_guide/assembly-requirements-for-container-images_openshift-sw-cert-policy-introduction#con-image-metadata-requirements_openshift-sw-cert-policy-container-images |
| 56 | + "name" = "Slurm Operator" |
| 57 | + "summary" = "Kubernetes Operator for Slurm" |
| 58 | + "description" = "Kubernetes Operator for Slurm" |
| 59 | + } |
| 60 | + tags = [ |
| 61 | + format_tag("${REGISTRY}", "slurm-operator", "${VERSION}"), |
| 62 | + ] |
| 63 | +} |
| 64 | + |
| 65 | +################################################################################ |
| 66 | + |
| 67 | +target "webhook" { |
| 68 | + inherits = ["_common"] |
| 69 | + dockerfile = "build/Dockerfile.webhook" |
| 70 | + labels = { |
| 71 | + # Ref: https://github.com/opencontainers/image-spec/blob/v1.0/annotations.md |
| 72 | + "org.opencontainers.image.title" = "Slurm Operator Webhook" |
| 73 | + "org.opencontainers.image.description" = "Kubernetes Operator Webhook for Slurm" |
| 74 | + # Ref: https://docs.redhat.com/en/documentation/red_hat_software_certification/2025/html/red_hat_openshift_software_certification_policy_guide/assembly-requirements-for-container-images_openshift-sw-cert-policy-introduction#con-image-metadata-requirements_openshift-sw-cert-policy-container-images |
| 75 | + "name" = "Slurm Operator Webhook" |
| 76 | + "summary" = "Kubernetes Operator Webhook for Slurm" |
| 77 | + "description" = "Kubernetes Operator Webhook for Slurm" |
| 78 | + } |
| 79 | + tags = [ |
| 80 | + format_tag("${REGISTRY}", "slurm-operator-webhook", "${VERSION}"), |
| 81 | + ] |
| 82 | +} |
0 commit comments