Reduce templates to those with matching container images
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
28b72d552b
commit
62c6f1fa15
97
.drone.star
97
.drone.star
@ -1,3 +1,11 @@
|
||||
ALPINE_VERSIONS = ("3.20", "edge")
|
||||
JAVA_MAVEN_VERSIONS = ("21",)
|
||||
JAVA_GRADLE_VERSIONS = ("8.3-jdk17",)
|
||||
PYTHON_VERSIONS = ("3.12",)
|
||||
RUST_VERSIONS = ("1.71",)
|
||||
SPLUNK_VERSIONS = ("9.1", "9.2")
|
||||
UBUNTU_VERSIONS = ("24.04",)
|
||||
|
||||
TEMPLATES = {
|
||||
"_distro": {
|
||||
"alpine": {
|
||||
@ -5,7 +13,7 @@ TEMPLATES = {
|
||||
"distro_shortname": "alpine",
|
||||
"distro_icon": "https://s3.mcmaster.io/images/Alpine_Linux_logo.png",
|
||||
"distro_package_manager": "apk",
|
||||
"distro_releases": ["3.17", "3.18", "3.19", "3.20", "edge"],
|
||||
"distro_releases": ALPINE_VERSIONS,
|
||||
"image": "cr.smcm.xyz/coder-images/alpine",
|
||||
},
|
||||
"aports": {
|
||||
@ -17,118 +25,39 @@ TEMPLATES = {
|
||||
"image": "cr.smcm.xyz/coder-images/alpine",
|
||||
"startup_scripts": ["alpine_aports"],
|
||||
},
|
||||
# "gcloud-terraform": {
|
||||
# "distro_name": "Ubuntu Linux",
|
||||
# "distro_shortname": "ubuntu",
|
||||
# "distro_icon": "/icon/ubuntu.svg",
|
||||
# "distro_package_manager": "apt",
|
||||
# "distro_releases": [],
|
||||
# "image": "cr.smcm.xyz/coder-images/coder-devops",
|
||||
# # "startup_scripts": ["gcloud", "terraform"],
|
||||
# },
|
||||
# "ollama-quantize": {
|
||||
# "distro_name": "Debian Linux",
|
||||
# "distro_shortname": "debian",
|
||||
# "distro_icon": "/icons/debian.svg",
|
||||
# "distro_package_manager": "apt",
|
||||
# "distro_releases": [],
|
||||
# "image": "cr.smcm.xyz/coder-images/ollama:quantize",
|
||||
# "coder_home_disk_size": "100",
|
||||
# "startup_scripts": ["ollama"]
|
||||
# },
|
||||
"ubuntu": {
|
||||
"distro_name": "Ubuntu Linux",
|
||||
"distro_shortname": "ubuntu",
|
||||
"distro_icon": "/icon/ubuntu.svg",
|
||||
"distro_package_manager": "apt",
|
||||
"distro_releases": ["20.04", "22.04", "23.04", "23.10", "24.04"],
|
||||
"distro_releases": UBUNTU_VERSIONS,
|
||||
"image": "cr.smcm.xyz/coder-images/ubuntu",
|
||||
},
|
||||
},
|
||||
"_lang": {
|
||||
"eclipse-temurin": {
|
||||
"lang": "eclipse-temurin",
|
||||
"lang_icon": "/icon/java.svg",
|
||||
"versions": ["11-jdk", "17-jdk", "21-jdk"],
|
||||
"distro_choices": [
|
||||
{"label": "Ubuntu Jammy", "suffix": "-jammy"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
"golang": {
|
||||
"lang": "golang",
|
||||
"lang_icon": "/icon/go.svg",
|
||||
"versions": ["1.21"],
|
||||
"distro_choices": [
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
"gradle": {
|
||||
"lang": "gradle",
|
||||
"lang_icon": "/icon/java.svg",
|
||||
"versions": ["8.3-jdk17"],
|
||||
"versions": JAVA_GRADLE_VERSIONS,
|
||||
"coder_user": "gradle",
|
||||
"distro_choices": [
|
||||
{"label": "Debian", "suffix": ""},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
"maven": {
|
||||
"lang": "maven",
|
||||
"lang_icon": "/icon/java.svg",
|
||||
"versions": ["11", "17", "21"],
|
||||
"versions": JAVA_MAVEN_VERSIONS,
|
||||
"tag_prefix": "3-eclipse-temurin-",
|
||||
"distro_choices": [
|
||||
{"label": "Ubuntu", "suffix": ""},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
"node": {
|
||||
"lang": "node",
|
||||
"lang_icon": "/icon/node.svg",
|
||||
"versions": ["18", "20"],
|
||||
"coder_user": "node",
|
||||
"distro_choices": [
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
"python": {
|
||||
"lang": "python",
|
||||
"lang_icon": "/icon/python.svg",
|
||||
"versions": ["3.8", "3.11"],
|
||||
"distro_choices": [
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
},
|
||||
"rust": {
|
||||
"lang": "rust",
|
||||
"lang_icon": "/icon/rust.svg",
|
||||
"versions": ["1.71"],
|
||||
"distro_choices": [
|
||||
{"label": "Debian Bookworm", "suffix": "-bookworm"},
|
||||
{"label": "Alpine Linux", "suffix": "-alpine"},
|
||||
],
|
||||
"versions": RUST_VERSIONS,
|
||||
},
|
||||
},
|
||||
# "android": {
|
||||
# "android-2023-06": {
|
||||
# "image": "cr.smcm.xyz/coder-images/android:2023.06",
|
||||
# "coder_user": "circleci",
|
||||
# "coder_user_uid": "1001",
|
||||
# "coder_user_gid": "1002",
|
||||
# "vs_code_root": "/home/circleci/project",
|
||||
# },
|
||||
# },
|
||||
# "jupyter": {
|
||||
# "jupyter-scipy-notebook": {
|
||||
# "image": "cr.smcm.xyz/coder-images/jupyter:scipy-notebook",
|
||||
# "coder_user": "jovyan",
|
||||
# "coder_user_gid": "100",
|
||||
# },
|
||||
# },
|
||||
"splunk": {
|
||||
"splunk": {
|
||||
"image": "cr.smcm.xyz/coder-images/splunk",
|
||||
|
||||
31
_lang.tf.j2
31
_lang.tf.j2
@ -4,6 +4,10 @@
|
||||
{% set tag_prefix = "" %}
|
||||
{% endif %}
|
||||
|
||||
{% if tag_suffix is not defined %}
|
||||
{% set tag_suffix = "" %}
|
||||
{% endif %}
|
||||
|
||||
{% block parameters %}
|
||||
{{ super() }}
|
||||
|
||||
@ -17,10 +21,6 @@ data "coder_parameter" "version" {
|
||||
{% endif %}
|
||||
|
||||
mutable = true
|
||||
option {
|
||||
name = "Latest"
|
||||
value = ""
|
||||
}
|
||||
{% for version in versions %}
|
||||
option {
|
||||
name = "{{ version }}"
|
||||
@ -29,27 +29,6 @@ data "coder_parameter" "version" {
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
{% if distro_choices %}
|
||||
data "coder_parameter" "container_base" {
|
||||
name = "Container Base"
|
||||
description = "Container Base"
|
||||
type = "string"
|
||||
default = "{{ distro_choices[0]["suffix"] }}"
|
||||
mutable = false
|
||||
{% for distro_choice in distro_choices %}
|
||||
option {
|
||||
name = "{{ distro_choice["label"] }}"
|
||||
value = "{{ distro_choice["suffix"] }}"
|
||||
}
|
||||
{% endfor %}
|
||||
}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block kubernetes_pod_main_image %}
|
||||
{% if distro_choices %}
|
||||
image = "cr.smcm.xyz/coder-images/{{lang}}:{{tag_prefix}}${data.coder_parameter.version.value}${data.coder_parameter.container_base.value}"
|
||||
{% else %}
|
||||
image = "cr.smcm.xyz/coder-images/{{lang}}:{{tag_prefix}}${data.coder_parameter.version.value}"
|
||||
{% endif %}
|
||||
image = "cr.smcm.xyz/coder-images/{{lang}}:{{tag_prefix}}${data.coder_parameter.version.value}{{tag_suffix}}"
|
||||
{% endblock %}
|
||||
@ -69,6 +69,7 @@ resource "coder_script" "splunk_ansible" {
|
||||
script = <<EOT
|
||||
#!/bin/bash
|
||||
|
||||
sudo microdnf install --assumeyes glibc-langpack-en
|
||||
sudo -E -u ansible /sbin/entrypoint.sh start-and-exit
|
||||
EOT
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user