update
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Steve McMaster 2024-02-03 14:23:08 -05:00
parent 9411a5080c
commit 4bda1e0226
5 changed files with 37 additions and 32 deletions

View File

@ -32,6 +32,14 @@ TEMPLATES = {
"image": "cr.smcm.xyz/coder-images/coder-devops", "image": "cr.smcm.xyz/coder-images/coder-devops",
# "startup_scripts": ["gcloud", "terraform"], # "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/coder-ollama-quantize",
},
"ubuntu": { "ubuntu": {
"distro_name": "Ubuntu Linux", "distro_name": "Ubuntu Linux",
"distro_shortname": "ubuntu", "distro_shortname": "ubuntu",
@ -48,7 +56,7 @@ TEMPLATES = {
"lang_icon": "/icon/java.svg", "lang_icon": "/icon/java.svg",
"versions": ["11-jdk", "17-jdk", "21-jdk"], "versions": ["11-jdk", "17-jdk", "21-jdk"],
"distro_choices": [ "distro_choices": [
{"label": "Ubuntu", "suffix": ""}, {"label": "Ubuntu Jammy", "suffix": "-jammy"},
{"label": "Alpine Linux", "suffix": "-alpine"}, {"label": "Alpine Linux", "suffix": "-alpine"},
], ],
}, },
@ -57,7 +65,7 @@ TEMPLATES = {
"lang_icon": "/icon/go.svg", "lang_icon": "/icon/go.svg",
"versions": ["1.21"], "versions": ["1.21"],
"distro_choices": [ "distro_choices": [
{"label": "Debian", "suffix": ""}, {"label": "Debian Bookworm", "suffix": "-bookworm"},
{"label": "Alpine Linux", "suffix": "-alpine"}, {"label": "Alpine Linux", "suffix": "-alpine"},
], ],
}, },
@ -72,9 +80,10 @@ TEMPLATES = {
], ],
}, },
"maven": { "maven": {
"lang": "eclipse-temurin-maven", "lang": "maven",
"lang_icon": "/icon/java.svg", "lang_icon": "/icon/java.svg",
"versions": ["11", "17", "21"], "versions": ["11", "17", "21"],
"tag_prefix": "3-eclipse-temurin-",
"distro_choices": [ "distro_choices": [
{"label": "Ubuntu", "suffix": ""}, {"label": "Ubuntu", "suffix": ""},
{"label": "Alpine Linux", "suffix": "-alpine"}, {"label": "Alpine Linux", "suffix": "-alpine"},
@ -86,7 +95,7 @@ TEMPLATES = {
"versions": ["18", "20"], "versions": ["18", "20"],
"coder_user": "node", "coder_user": "node",
"distro_choices": [ "distro_choices": [
{"label": "Debian", "suffix": ""}, {"label": "Debian Bookworm", "suffix": "-bookworm"},
{"label": "Alpine Linux", "suffix": "-alpine"}, {"label": "Alpine Linux", "suffix": "-alpine"},
], ],
}, },
@ -95,7 +104,7 @@ TEMPLATES = {
"lang_icon": "/icon/python.svg", "lang_icon": "/icon/python.svg",
"versions": ["3.8", "3.11"], "versions": ["3.8", "3.11"],
"distro_choices": [ "distro_choices": [
{"label": "Debian", "suffix": ""}, {"label": "Debian Bookworm", "suffix": "-bookworm"},
{"label": "Alpine Linux", "suffix": "-alpine"}, {"label": "Alpine Linux", "suffix": "-alpine"},
], ],
}, },
@ -104,14 +113,14 @@ TEMPLATES = {
"lang_icon": "/icon/rust.svg", "lang_icon": "/icon/rust.svg",
"versions": ["1.71"], "versions": ["1.71"],
"distro_choices": [ "distro_choices": [
{"label": "Debian", "suffix": ""}, {"label": "Debian Bookworm", "suffix": "-bookworm"},
{"label": "Alpine Linux", "suffix": "-alpine"}, {"label": "Alpine Linux", "suffix": "-alpine"},
], ],
}, },
}, },
"android": { "android": {
"android-2023-06": { "android-2023-06": {
"image": "cr.smcm.xyz/coder-images/android-2023.06", "image": "cr.smcm.xyz/coder-images/android:2023.06",
"coder_user": "circleci", "coder_user": "circleci",
"coder_user_uid": "1001", "coder_user_uid": "1001",
"coder_user_gid": "1002", "coder_user_gid": "1002",
@ -120,7 +129,7 @@ TEMPLATES = {
}, },
"jupyter": { "jupyter": {
"jupyter-scipy-notebook": { "jupyter-scipy-notebook": {
"image": "cr.smcm.xyz/coder-images/jupyter-scipy-notebook", "image": "cr.smcm.xyz/coder-images/jupyter:scipy-notebook",
"coder_user": "jovyan", "coder_user": "jovyan",
"coder_user_gid": "100", "coder_user_gid": "100",
}, },
@ -128,7 +137,7 @@ TEMPLATES = {
"splunk": { "splunk": {
"splunk": { "splunk": {
"image": "cr.smcm.xyz/coder-images/splunk", "image": "cr.smcm.xyz/coder-images/splunk",
"splunk_versions": ["8.2", "9.0", "9.1"], "splunk_versions": ["8.2", "9.0", "9.1", "9.2"],
"coder_user": "splunk", "coder_user": "splunk",
"coder_user_home": "/opt/splunk/etc", "coder_user_home": "/opt/splunk/etc",
"coder_user_uid": "41812", "coder_user_uid": "41812",
@ -136,12 +145,6 @@ TEMPLATES = {
"vs_code_root": "/opt/splunk", "vs_code_root": "/opt/splunk",
}, },
}, },
"terraform": {
"terraform": {
"image": "cr.smcm.xyz/coder-images/terraform",
"terraform_versions": ["1.6"],
},
},
} }
def main(ctx): def main(ctx):

View File

@ -7,25 +7,21 @@ data "coder_parameter" "distro_release" {
name = "{{ distro_name }} Release" name = "{{ distro_name }} Release"
description = "{{ distro_name }} Release" description = "{{ distro_name }} Release"
type = "string" type = "string"
default = "" default = "{{ distro_releases[-1] }}"
{% if distro_icon %} {% if distro_icon %}
icon = "{{ distro_icon }}" icon = "{{ distro_icon }}"
{% endif %} {% endif %}
mutable = true mutable = true
option {
name = "Latest"
value = ""
}
{% for version in distro_releases %} {% for version in distro_releases %}
option { option {
name = "{{ version }}" name = "{{ version }}"
value = "-{{ version }}" value = "{{ version }}"
} }
{% endfor %} {% endfor %}
} }
{% endblock %} {% endblock %}
{% block kubernetes_pod_main_image %} {% block kubernetes_pod_main_image %}
image = "{{image}}${data.coder_parameter.distro_release.value}:latest" image = "{{image}}:${data.coder_parameter.distro_release.value}"
{% endblock %} {% endblock %}

View File

@ -1,5 +1,9 @@
{% extends "base.tf.j2" %} {% extends "base.tf.j2" %}
{% if tag_prefix is not defined %}
{% set tag_prefix = "" %}
{% endif %}
{% block parameters %} {% block parameters %}
{{ super() }} {{ super() }}
@ -7,7 +11,7 @@ data "coder_parameter" "version" {
name = "{{lang}} Version" name = "{{lang}} Version"
description = "{{lang}} Version" description = "{{lang}} Version"
type = "string" type = "string"
default = "" default = "{{ versions[-1] }}"
{% if lang_icon %} {% if lang_icon %}
icon = "{{ lang_icon }}" icon = "{{ lang_icon }}"
{% endif %} {% endif %}
@ -20,11 +24,12 @@ data "coder_parameter" "version" {
{% for version in versions %} {% for version in versions %}
option { option {
name = "{{ version }}" name = "{{ version }}"
value = "-{{ version }}" value = "{{ version }}"
} }
{% endfor %} {% endfor %}
} }
{% if distro_choices %}
data "coder_parameter" "container_base" { data "coder_parameter" "container_base" {
name = "Container Base" name = "Container Base"
description = "Container Base" description = "Container Base"
@ -38,8 +43,13 @@ data "coder_parameter" "container_base" {
} }
{% endfor %} {% endfor %}
} }
{% endif %}
{% endblock %} {% endblock %}
{% block kubernetes_pod_main_image %} {% block kubernetes_pod_main_image %}
image = "cr.smcm.xyz/coder-images/{{lang}}${data.coder_parameter.version.value}${data.coder_parameter.container_base.value}:latest" {% 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 %}
{% endblock %} {% endblock %}

View File

@ -411,7 +411,7 @@ resource "kubernetes_deployment" "main" {
container { container {
name = "dev" name = "dev"
{% block kubernetes_pod_main_image %} {% block kubernetes_pod_main_image %}
image = "{{image}}:latest" image = "{{image}}"
{% endblock %} {% endblock %}
{% block kubernetes_pod_main_command %} {% block kubernetes_pod_main_command %}
command = ["bash", "-c", coder_agent.main.init_script] command = ["bash", "-c", coder_agent.main.init_script]

View File

@ -45,14 +45,10 @@ data "coder_parameter" "splunk_version" {
name = "Splunk Version" name = "Splunk Version"
description = "Splunk Version" description = "Splunk Version"
type = "string" type = "string"
default = "" default = "{{ splunk_versions[-1] }}"
icon = "https://s3.mcmaster.io/images/Splunk.webp" icon = "https://s3.mcmaster.io/images/Splunk.webp"
mutable = true mutable = true
option {
name = "Latest"
value = ""
}
{% for version in splunk_versions %} {% for version in splunk_versions %}
option { option {
name = "{{ version }}" name = "{{ version }}"
@ -79,5 +75,5 @@ resource "coder_script" "splunk_ansible" {
{% endblock %} {% endblock %}
{% block kubernetes_pod_main_image %} {% block kubernetes_pod_main_image %}
image = "{{image}}${data.coder_parameter.splunk_version.value}:latest" image = "{{image}}:${data.coder_parameter.splunk_version.value}"
{% endblock %} {% endblock %}