diff --git a/.gitignore b/.gitignore index b9cdefe..a2893af 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ .terraform.d .dump .buildx-cache +*.tar diff --git a/Dockerfile b/Dockerfile index 1d3d93c..08d4fb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN <<'EOF' # tar cf - $tdir | lz4 -v -5 > tf.lz4 && rm -rf $tdir tar cf - $tdir | zstd --compress > tf.zst && rm -rf $tdir EOF + # ENV DECOMPRESS_CMD="lz4 -d tf.lz4 | tar xf -" ENV DECOMPRESS_CMD="zstd --decompress tf.zst --stdout | tar xf -" ENV TEMPLATES_DIR="/app/infrastructure-templates" diff --git a/Taskfile.yml b/Taskfile.yml index e8cdcc2..a2483d2 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -67,11 +67,11 @@ tasks: - sh: '[[ -n "{{.Image}}" ]]' msg: 'var Image must have a value' vars: - Push: true - DockerArgs: "" + push: true + dockerArgs: "{{.DockerArgs | default ''}}" cmds: - - docker build -t {{.Image}} . {{.DockerArgs}} + - docker build -t {{.Image}} . {{.dockerArgs}} - |+ - if [ "{{.Push}}" == "true" ]; then + if [ "{{.push}}" == "true" ]; then docker push {{.Image}} fi diff --git a/terraform/bundles/gcp/worker-nodes/main.tf b/terraform/bundles/gcp/worker-nodes/main.tf index fb34457..5cc900f 100644 --- a/terraform/bundles/gcp/worker-nodes/main.tf +++ b/terraform/bundles/gcp/worker-nodes/main.tf @@ -71,10 +71,11 @@ module "worker-nodes" { tf_node_labels = jsonencode(merge(var.node_labels, { (module.constants.node_labels.provider_az) = var.availability_zone (module.constants.node_labels.node_has_role) = "agent" - (module.constants.node_labels.nodepool_name) : var.nodepool_name, + (module.constants.node_labels.nodepool_name) : var.nodepool_name (module.constants.node_labels.provider_aws_instance_profile_name) : "" }, - # var.nvidia_gpu_enabled == true ? { (module.constants.node_labels.node_has_gpu) : "true" } : {} + var.provision_mode == "SPOT" ? { (module.constants.node_labels.node_is_spot) = "true" } : {}, + # var.nvidia_gpu_enabled == true ? { (module.constants.node_labels.node_has_gpu) : "true" } : {} )) tf_node_name = "${var.nodepool_name}-${each.key}" tf_use_cloudflare_nameserver = true