feat: first commit
- add base image for docker and incus - manage images for almalinux 8.10 and 9.5 - replace all existing docker build repos
This commit is contained in:
commit
ff19688dd2
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
images/**/library_*
|
||||
env
|
||||
107
Makefile
Normal file
107
Makefile
Normal file
@ -0,0 +1,107 @@
|
||||
# Base directories
|
||||
IMAGES_PATH := images
|
||||
LIBRARY_PATH := library
|
||||
SYMLINK_PREFIX := library_
|
||||
|
||||
# Docker registry variables
|
||||
REGISTRY := git.query.consul
|
||||
OWNER := unkin
|
||||
#GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
||||
DATE_TAG := $(shell date +%Y%m%d)
|
||||
BRANCH=$(shell git branch --show-current)
|
||||
|
||||
# Find all subdirectories under the IMAGES_PATH
|
||||
DIRS := $(shell find $(IMAGES_PATH) -mindepth 3 -maxdepth 3 -type d | sed 's|$(IMAGES_PATH)/||')
|
||||
TAGS := $(shell find $(IMAGES_PATH) -mindepth 3 -maxdepth 3 -type d | sed 's|$(IMAGES_PATH)/|tag-|')
|
||||
PUSH := $(shell find $(IMAGES_PATH) -mindepth 3 -maxdepth 3 -type d | sed 's|$(IMAGES_PATH)/|push-|')
|
||||
|
||||
.PHONY: list $(DIRS)
|
||||
|
||||
# List all directories
|
||||
list:
|
||||
@echo "Images:"
|
||||
@for dir in $(DIRS); do \
|
||||
echo " '$$dir'"; \
|
||||
done
|
||||
|
||||
# Dynamically create targets for each directory
|
||||
.ONESHELL:
|
||||
$(DIRS):
|
||||
@echo "Building for $@"
|
||||
|
||||
# Check if on master branch
|
||||
@if [ "$(BRANCH)" = "master" ]; then \
|
||||
echo "Current branch is $(BRANCH), checking latest timestamp in consul."; \
|
||||
LAST_BUILD_TIMESTAMP=$$(consul kv get infra/packer/$@/timestamp || echo "0"); \
|
||||
CURRENT_TIME=$$(date +%s); \
|
||||
if [ $$((CURRENT_TIME - LAST_BUILD_TIMESTAMP)) -lt 86400 ]; then \
|
||||
echo "Skipping build for $@ (built within the last 24 hours)"; \
|
||||
exit 0; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
# Link .hcl files
|
||||
@find $(LIBRARY_PATH) -name '*.hcl' -exec sh -c 'ln -sf $$PWD/{} $(IMAGES_PATH)/$@/$(SYMLINK_PREFIX)$$(basename {})' \;
|
||||
|
||||
# Link builds
|
||||
@for build in $$(cat $(IMAGES_PATH)/$@/builds); do \
|
||||
ln -sf ../../../../builds/$${build}.pkr.hcl $(IMAGES_PATH)/$@/library_$${build}.build.pkr.hcl; \
|
||||
done
|
||||
|
||||
# Build the image
|
||||
@(cd $(IMAGES_PATH)/$@ && \
|
||||
export DATE=$(DATE_TAG) && \
|
||||
export OS_NAME=$$(echo $@ | cut -d'/' -f1) && \
|
||||
export OS_VERSION_FULL=$$(echo $@ | cut -d'/' -f2) && \
|
||||
export OS_IMAGE=$$(echo $@ | cut -d'/' -f3) && \
|
||||
export OS_VERSION_MAJOR=$$(echo $$OS_VERSION_FULL | cut -d'.' -f1) && \
|
||||
export DOCKER_SOURCE=$$OS_NAME:$$OS_VERSION_FULL && \
|
||||
export DOCKER_SERVER='git.query.consul' && \
|
||||
export INCUS_SOURCE="images:$$OS_NAME/$$OS_VERSION_MAJOR" && \
|
||||
export SUFFIX=$$(basename $$(mktemp -u) | cut -d . -f 2) && \
|
||||
export GIT_BRANCH=$(BRANCH) && \
|
||||
packer init . && \
|
||||
packer build . )
|
||||
|
||||
# Update build timestamp and date in Consul if on master branch
|
||||
@if [ "$(BRANCH)" = "master" ]; then \
|
||||
echo "Current branch is $(BRANCH), updating consul."; \
|
||||
CURRENT_TIMESTAMP=$$(date +%s); \
|
||||
READABLE_DATE=$$(date '+%Y-%m-%d %H:%M:%S %Z'); \
|
||||
consul kv put infra/packer/$@/timestamp $$CURRENT_TIMESTAMP; \
|
||||
consul kv put infra/packer/$@/date "$$READABLE_DATE"; \
|
||||
fi
|
||||
|
||||
.PHONY: $(DIRS) $(TAGS) $(PUSH)
|
||||
|
||||
# Tag Docker images
|
||||
$(TAGS):
|
||||
@echo "Tagging Docker image for $$(echo $@ | sed 's|tag-||')"
|
||||
@OS_NAME=$$(echo "$@" | sed 's|tag-||' | cut -d'/' -f1); \
|
||||
OS_VERSION_FULL=$$(echo "$@" | sed 's|tag-||' | cut -d'/' -f2); \
|
||||
OS_IMAGE=$$(echo "$@" | sed 's|tag-||' | cut -d'/' -f3); \
|
||||
OS_VERSION_MAJOR=$$(echo $$OS_VERSION_FULL | cut -d'.' -f1); \
|
||||
IMAGE_NAME="$(REGISTRY)/$(OWNER)/$$OS_NAME$$OS_VERSION_MAJOR-$$OS_IMAGE"; \
|
||||
echo "Tagging Image Name: $$IMAGE_NAME:$(DATE_TAG)"; \
|
||||
docker tag $$IMAGE_NAME $$IMAGE_NAME:$(DATE_TAG); \
|
||||
echo "Tagging Image Name: $$IMAGE_NAME:latest"; \
|
||||
docker tag $$IMAGE_NAME $$IMAGE_NAME:latest
|
||||
|
||||
# Push Docker images
|
||||
$(PUSH):
|
||||
@echo "Pushing Docker image for $$(echo $@ | sed 's|push-||')"
|
||||
@OS_NAME=$$(echo "$@" | sed 's|push-||' | cut -d'/' -f1); \
|
||||
OS_VERSION_FULL=$$(echo "$@" | sed 's|push-||' | cut -d'/' -f2); \
|
||||
OS_IMAGE=$$(echo "$@" | sed 's|push-||' | cut -d'/' -f3); \
|
||||
OS_VERSION_MAJOR=$$(echo $$OS_VERSION_FULL | cut -d'.' -f1); \
|
||||
IMAGE_NAME="$(REGISTRY)/$(OWNER)/$$OS_NAME$$OS_VERSION_MAJOR-$$OS_IMAGE"; \
|
||||
echo "Pushing Image Name: $$IMAGE_NAME:$(DATE_TAG)"; \
|
||||
docker push $$IMAGE_NAME:$(DATE_TAG); \
|
||||
echo "Pushing Image Name: $$IMAGE_NAME:latest"; \
|
||||
docker push $$IMAGE_NAME:latest
|
||||
|
||||
# Clean all symlinks
|
||||
clean:
|
||||
@echo "Cleaning up symlinks..."
|
||||
@find $(IMAGES_PATH) -name 'library_*' -type l -delete
|
||||
@echo "All symlinks removed!"
|
||||
69
builds/docker.pkr.hcl
Normal file
69
builds/docker.pkr.hcl
Normal file
@ -0,0 +1,69 @@
|
||||
build {
|
||||
name = local.build_name
|
||||
sources = [
|
||||
"source.docker.os",
|
||||
]
|
||||
|
||||
# pre-file-copy scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_pre_file_copy
|
||||
}
|
||||
|
||||
# Deploy files from the image directory -> root of machine
|
||||
provisioner "file" {
|
||||
source = var.deploy_files_from_image ? "./files/" : ""
|
||||
destination = "/"
|
||||
}
|
||||
|
||||
# Deploy files from the common directory -> root of machine
|
||||
provisioner "file" {
|
||||
source = var.deploy_files_from_common ? "../../../../files/${var.os_name}/${var.os_image}/" : ""
|
||||
destination = "/"
|
||||
}
|
||||
|
||||
# post-file-copy scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_post_file_copy
|
||||
}
|
||||
|
||||
# pre-packages scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_pre_packages
|
||||
}
|
||||
|
||||
# manage dnf/packages
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"dnf install -y ${join(" ", var.packages)}"
|
||||
]
|
||||
}
|
||||
|
||||
# post-packages scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_post_packages
|
||||
}
|
||||
|
||||
# final scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_final
|
||||
}
|
||||
|
||||
|
||||
post-processors {
|
||||
post-processor "docker-tag" {
|
||||
repository = "${var.docker_server}/unkin/${var.os_name}${var.os_version_major}-${var.os_image}"
|
||||
tags = ["latest", var.date]
|
||||
}
|
||||
|
||||
dynamic "post-processor" {
|
||||
for_each = local.is_master ? [1] : []
|
||||
labels = ["docker-push"]
|
||||
content {
|
||||
login = true
|
||||
login_server = var.docker_server
|
||||
login_username = var.docker_username
|
||||
login_password = var.docker_password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
60
builds/incus.pkr.hcl
Normal file
60
builds/incus.pkr.hcl
Normal file
@ -0,0 +1,60 @@
|
||||
build {
|
||||
name = local.build_name
|
||||
sources = [
|
||||
"source.incus.os"
|
||||
]
|
||||
|
||||
# pre-file-copy scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_pre_file_copy
|
||||
}
|
||||
|
||||
# Deploy files from the image directory -> root of machine
|
||||
provisioner "file" {
|
||||
source = var.deploy_files_from_image ? "./files/" : ""
|
||||
destination = "/"
|
||||
}
|
||||
|
||||
# Deploy files from the common directory -> root of machine
|
||||
provisioner "file" {
|
||||
source = var.deploy_files_from_common ? "../../../../files/${var.os_name}/${var.os_image}/" : ""
|
||||
destination = "/"
|
||||
}
|
||||
|
||||
# post-file-copy scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_post_file_copy
|
||||
}
|
||||
|
||||
# pre-packages scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_pre_packages
|
||||
}
|
||||
|
||||
# manage dnf/packages
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"dnf install -y ${join(" ", var.packages)}"
|
||||
]
|
||||
}
|
||||
|
||||
# post-packages scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_post_packages
|
||||
}
|
||||
|
||||
# final scripts
|
||||
provisioner "shell" {
|
||||
inline = var.scripts_final
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
inline = [
|
||||
"incus image alias delete local:${local.incus_base_name}/latest || true",
|
||||
"incus image alias delete local:${local.incus_base_name}/${var.date} || true",
|
||||
"incus image info local:${local.incus_output_image} | grep Fingerprint | awk '{print $2}'",
|
||||
"incus image alias create local:${local.incus_base_name}/latest $(incus image info local:${local.incus_output_image} | grep Fingerprint | awk '{print $2}')",
|
||||
"incus image alias create local:${local.incus_base_name}/${var.date} $(incus image info local:${local.incus_output_image} | grep Fingerprint | awk '{print $2}')"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
files/almalinux/jupyterlab/etc/sudoers.d/10-jupyter
Normal file
1
files/almalinux/jupyterlab/etc/sudoers.d/10-jupyter
Normal file
@ -0,0 +1 @@
|
||||
jupyter ALL=(ALL) NOPASSWD: /usr/bin/dnf
|
||||
7
files/almalinux/jupyterlab/tmp/jupyter_requirements.txt
Normal file
7
files/almalinux/jupyterlab/tmp/jupyter_requirements.txt
Normal file
@ -0,0 +1,7 @@
|
||||
jupyterhub==5.2.1
|
||||
notebook==7.2.2
|
||||
numpy
|
||||
pandas
|
||||
matplotlib
|
||||
pyarrow
|
||||
pyyaml
|
||||
1
images/almalinux/8.10/actionsdind/builds
Normal file
1
images/almalinux/8.10/actionsdind/builds
Normal file
@ -0,0 +1 @@
|
||||
docker
|
||||
18
images/almalinux/8.10/actionsdind/variables.auto.pkrvars.hcl
Normal file
18
images/almalinux/8.10/actionsdind/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,18 @@
|
||||
# almalinux/8.10/actionsdind
|
||||
docker_source = "git.query.consul/unkin/almalinux8-base:latest"
|
||||
packages = [
|
||||
"bash",
|
||||
"docker-ce-cli",
|
||||
"make",
|
||||
"nodejs",
|
||||
"unzip"
|
||||
]
|
||||
scripts_pre_packages = [
|
||||
"dnf install -y yum-utils",
|
||||
"dnf module enable -y nodejs:20",
|
||||
"yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo"
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
2
images/almalinux/8.10/base/builds
Normal file
2
images/almalinux/8.10/base/builds
Normal file
@ -0,0 +1,2 @@
|
||||
docker
|
||||
incus
|
||||
@ -0,0 +1,6 @@
|
||||
[appstream]
|
||||
name=appstream repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/8.10/AppStream/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
@ -0,0 +1,6 @@
|
||||
[baseos]
|
||||
name=baseos repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/8.10/BaseOS/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
@ -0,0 +1,6 @@
|
||||
[epel]
|
||||
name=epel repository
|
||||
baseurl=https://edgecache.query.consul/epel/8/Everything/x86_64
|
||||
gpgkey=https://edgecache.query.consul/epel/RPM-GPG-KEY-EPEL-8
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
@ -0,0 +1,4 @@
|
||||
[extras]
|
||||
name=extras repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/8.10/extras/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||
@ -0,0 +1,4 @@
|
||||
[highavailability]
|
||||
name=highavailability repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/8.10/HighAvailability/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||
@ -0,0 +1,7 @@
|
||||
# replaced by crb repo in EL9
|
||||
[powertools]
|
||||
name=powertools repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/8.10/PowerTools/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-8
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
@ -0,0 +1,6 @@
|
||||
[unkin]
|
||||
name=unkin repository
|
||||
baseurl=https://git.query.consul/api/packages/unkin/rpm/almalinux/el8
|
||||
gpgkey=https://git.query.consul/api/packages/unkin/rpm/repository.key
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
@ -0,0 +1,7 @@
|
||||
# only available on EL8
|
||||
[unkinben]
|
||||
name=unkinben repository
|
||||
baseurl=https://git.query.consul/api/packages/unkinben/rpm/el8
|
||||
gpgkey=https://git.query.consul/api/packages/unkinben/rpm/repository.key
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
22
images/almalinux/8.10/base/variables.auto.pkrvars.hcl
Normal file
22
images/almalinux/8.10/base/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,22 @@
|
||||
# almalinux/8.10/base
|
||||
deploy_files_from_image = true
|
||||
deploy_files_from_common = true
|
||||
use_incus = true
|
||||
packages = [
|
||||
"git",
|
||||
"jq",
|
||||
"uv",
|
||||
"wget",
|
||||
]
|
||||
scripts_pre_file_copy = [
|
||||
"rm -f /etc/yum.repos.d/*.repo",
|
||||
"curl -k -o internal-ca-certificates.rpm https://git.query.consul/unkin/-/packages/rpm/internal-ca-certificates/20240825-1.el8/files/756 && rpm -i internal-ca-certificates.rpm"
|
||||
]
|
||||
scripts_pre_packages = [
|
||||
"dnf makecache",
|
||||
"dnf update -y",
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
1
images/almalinux/8.10/jupyterlab/builds
Normal file
1
images/almalinux/8.10/jupyterlab/builds
Normal file
@ -0,0 +1 @@
|
||||
docker
|
||||
33
images/almalinux/8.10/jupyterlab/variables.auto.pkrvars.hcl
Normal file
33
images/almalinux/8.10/jupyterlab/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,33 @@
|
||||
# almalinux/8.10/jupyterlab
|
||||
docker_source = "git.query.consul/unkin/almalinux8-base:latest"
|
||||
deploy_files_from_common = true
|
||||
packages = [
|
||||
"uv",
|
||||
"python3.11",
|
||||
"python3.11-pip",
|
||||
"python3.12",
|
||||
"python3.12-pip"
|
||||
]
|
||||
scripts_pre_file_copy = [
|
||||
"dnf install -y sudo",
|
||||
]
|
||||
scripts_post_packages = [
|
||||
"uv venv --python 3.12 /opt/jupyter && source /opt/jupyter/bin/activate && uv pip install -r /tmp/jupyter_requirements.txt && deactivate",
|
||||
"uv venv --python 3.11 /opt/ipykernels/python3.11 && source /opt/ipykernels/python3.11/bin/activate && uv pip install ipykernel && python -m ipykernel install --name ipykernel311 --display-name \"Python (3.11)\" && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/python3.12 && source /opt/ipykernels/python3.12/bin/activate && uv pip install ipykernel && python -m ipykernel install --name ipykernel312 --display-name \"Python (3.12)\" && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/bash && source /opt/ipykernels/bash/bin/activate && uv pip install bash_kernel && python -m bash_kernel.install --prefix /usr/local && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/zsh && source /opt/ipykernels/zsh/bin/activate && uv pip install zsh_jupyter_kernel && python -m zsh_jupyter_kernel.install --prefix /usr/local && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/vim && source /opt/ipykernels/vim/bin/activate && uv pip install vim_kernel && python -m vim_kernel.install --prefix /usr/local && deactivate",
|
||||
"useradd -m jupyter",
|
||||
"mkdir /home/jupyter/work",
|
||||
"chown jupyter:jupyter -Rv /home/jupyter/work"
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
docker_changes = [
|
||||
"USER jupyter",
|
||||
"WORKDIR /home/jupyter",
|
||||
"CMD [\"/opt/jupyter/bin/jupyterhub-singleuser\"]",
|
||||
]
|
||||
1
images/almalinux/8.10/rpmbuilder/builds
Normal file
1
images/almalinux/8.10/rpmbuilder/builds
Normal file
@ -0,0 +1 @@
|
||||
docker
|
||||
47
images/almalinux/8.10/rpmbuilder/variables.auto.pkrvars.hcl
Normal file
47
images/almalinux/8.10/rpmbuilder/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,47 @@
|
||||
# almalinux/8.10/rpmbuilder
|
||||
docker_source = "git.query.consul/unkin/almalinux8-base:latest"
|
||||
packages = [
|
||||
"asciidoc",
|
||||
"autoconf",
|
||||
"automake",
|
||||
"binutils",
|
||||
"bison",
|
||||
"byacc",
|
||||
"cmake",
|
||||
"diffstat",
|
||||
"flex",
|
||||
"gcc",
|
||||
"gcc-c++",
|
||||
"gdb",
|
||||
"glibc-devel",
|
||||
"go",
|
||||
"gzip",
|
||||
"intltool",
|
||||
"jna",
|
||||
"ltrace",
|
||||
"make",
|
||||
"nfpm",
|
||||
"patchutils",
|
||||
"perl-Fedora-VSP",
|
||||
"perl-generators",
|
||||
"pesign",
|
||||
"pkgconf",
|
||||
"pkgconf-m4",
|
||||
"pkgconf-pkg-config",
|
||||
"redhat-rpm-config",
|
||||
"rpm",
|
||||
"rpm-build",
|
||||
"rpm-sign",
|
||||
"rpmdevtools",
|
||||
"rpmlint",
|
||||
"source-highlight",
|
||||
"strace",
|
||||
"systemtap",
|
||||
"tar",
|
||||
"valgrind",
|
||||
"valgrind-devel",
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
1
images/almalinux/9.5/actionsdind/builds
Normal file
1
images/almalinux/9.5/actionsdind/builds
Normal file
@ -0,0 +1 @@
|
||||
docker
|
||||
18
images/almalinux/9.5/actionsdind/variables.auto.pkrvars.hcl
Normal file
18
images/almalinux/9.5/actionsdind/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,18 @@
|
||||
# almalinux/9.5/actionsdind
|
||||
docker_source = "git.query.consul/unkin/almalinux9-base:latest"
|
||||
packages = [
|
||||
"bash",
|
||||
"docker-ce-cli",
|
||||
"make",
|
||||
"nodejs",
|
||||
"unzip"
|
||||
]
|
||||
scripts_pre_packages = [
|
||||
"dnf install -y yum-utils",
|
||||
"dnf module enable -y nodejs:20",
|
||||
"yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo"
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
2
images/almalinux/9.5/base/builds
Normal file
2
images/almalinux/9.5/base/builds
Normal file
@ -0,0 +1,2 @@
|
||||
docker
|
||||
incus
|
||||
@ -0,0 +1,6 @@
|
||||
[appstream]
|
||||
name=appstream repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/9.5/AppStream/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
@ -0,0 +1,6 @@
|
||||
[baseos]
|
||||
name=baseos repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/9.5/BaseOS/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
5
images/almalinux/9.5/base/files/etc/yum.repos.d/crb.repo
Normal file
5
images/almalinux/9.5/base/files/etc/yum.repos.d/crb.repo
Normal file
@ -0,0 +1,5 @@
|
||||
# new repo for EL9+, replaces PowerTools repo
|
||||
[crb]
|
||||
name=crb repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/9.5/CRB/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||
@ -0,0 +1,6 @@
|
||||
[epel]
|
||||
name=epel repository
|
||||
baseurl=https://edgecache.query.consul/epel/9/Everything/x86_64
|
||||
gpgkey=https://edgecache.query.consul/epel/RPM-GPG-KEY-EPEL-9
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
@ -0,0 +1,4 @@
|
||||
[extras]
|
||||
name=extras repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/9.5/extras/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||
@ -0,0 +1,4 @@
|
||||
[highavailability]
|
||||
name=highavailability repository
|
||||
baseurl=https://edgecache.query.consul/almalinux/9.5/HighAvailability/x86_64/os
|
||||
gpgkey=https://edgecache.query.consul/almalinux/RPM-GPG-KEY-AlmaLinux-9
|
||||
@ -0,0 +1,6 @@
|
||||
[unkin]
|
||||
name=unkin repository
|
||||
baseurl=https://git.query.consul/api/packages/unkin/rpm/almalinux/el9
|
||||
gpgkey=https://git.query.consul/api/packages/unkin/rpm/repository.key
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
23
images/almalinux/9.5/base/variables.auto.pkrvars.hcl
Normal file
23
images/almalinux/9.5/base/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,23 @@
|
||||
# almalinux/9.5/base
|
||||
deploy_files_from_image = true
|
||||
deploy_files_from_common = true
|
||||
use_incus = true
|
||||
packages = [
|
||||
"git",
|
||||
"jq",
|
||||
"uv",
|
||||
"wget",
|
||||
]
|
||||
scripts_pre_file_copy = [
|
||||
"rm -f /etc/yum.repos.d/*.repo",
|
||||
"curl -k -o internal-ca-certificates.rpm https://git.query.consul/unkin/-/packages/rpm/internal-ca-certificates/20240825-1.el8/files/756 && rpm -i internal-ca-certificates.rpm"
|
||||
]
|
||||
scripts_pre_packages = [
|
||||
"dnf makecache",
|
||||
"dnf update -y",
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
|
||||
1
images/almalinux/9.5/jupyterlab/builds
Normal file
1
images/almalinux/9.5/jupyterlab/builds
Normal file
@ -0,0 +1 @@
|
||||
docker
|
||||
33
images/almalinux/9.5/jupyterlab/variables.auto.pkrvars.hcl
Normal file
33
images/almalinux/9.5/jupyterlab/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,33 @@
|
||||
# almalinux/9.5/jupyterlab
|
||||
deploy_files_from_common = true
|
||||
docker_source = "git.query.consul/unkin/almalinux9-base:latest"
|
||||
packages = [
|
||||
"uv",
|
||||
"python3.11",
|
||||
"python3.11-pip",
|
||||
"python3.12",
|
||||
"python3.12-pip"
|
||||
]
|
||||
scripts_pre_file_copy = [
|
||||
"dnf install -y sudo",
|
||||
]
|
||||
scripts_post_packages = [
|
||||
"uv venv --python 3.12 /opt/jupyter && source /opt/jupyter/bin/activate && uv pip install -r /tmp/jupyter_requirements.txt && deactivate",
|
||||
"uv venv --python 3.11 /opt/ipykernels/python3.11 && source /opt/ipykernels/python3.11/bin/activate && uv pip install ipykernel && python -m ipykernel install --name ipykernel311 --display-name \"Python (3.11)\" && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/python3.12 && source /opt/ipykernels/python3.12/bin/activate && uv pip install ipykernel && python -m ipykernel install --name ipykernel312 --display-name \"Python (3.12)\" && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/bash && source /opt/ipykernels/bash/bin/activate && uv pip install bash_kernel && python -m bash_kernel.install --prefix /usr/local && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/zsh && source /opt/ipykernels/zsh/bin/activate && uv pip install zsh_jupyter_kernel && python -m zsh_jupyter_kernel.install --prefix /usr/local && deactivate",
|
||||
"uv venv --python 3.12 /opt/ipykernels/vim && source /opt/ipykernels/vim/bin/activate && uv pip install vim_kernel && python -m vim_kernel.install --prefix /usr/local && deactivate",
|
||||
"useradd -m jupyter",
|
||||
"mkdir /home/jupyter/work",
|
||||
"chown jupyter:jupyter -Rv /home/jupyter/work"
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
docker_changes = [
|
||||
"USER jupyter",
|
||||
"WORKDIR /home/jupyter",
|
||||
"CMD [\"/opt/jupyter/bin/jupyterhub-singleuser\"]",
|
||||
]
|
||||
1
images/almalinux/9.5/rpmbuilder/builds
Normal file
1
images/almalinux/9.5/rpmbuilder/builds
Normal file
@ -0,0 +1 @@
|
||||
docker
|
||||
47
images/almalinux/9.5/rpmbuilder/variables.auto.pkrvars.hcl
Normal file
47
images/almalinux/9.5/rpmbuilder/variables.auto.pkrvars.hcl
Normal file
@ -0,0 +1,47 @@
|
||||
# almalinux/9.5/rpmbuilder
|
||||
docker_source = "git.query.consul/unkin/almalinux9-base:latest"
|
||||
packages = [
|
||||
"asciidoc",
|
||||
"autoconf",
|
||||
"automake",
|
||||
"binutils",
|
||||
"bison",
|
||||
"byacc",
|
||||
"cmake",
|
||||
"diffstat",
|
||||
"flex",
|
||||
"gcc",
|
||||
"gcc-c++",
|
||||
"gdb",
|
||||
"glibc-devel",
|
||||
"go",
|
||||
"gzip",
|
||||
"intltool",
|
||||
"jna",
|
||||
"ltrace",
|
||||
"make",
|
||||
"nfpm",
|
||||
"patchutils",
|
||||
"perl-Fedora-VSP",
|
||||
"perl-generators",
|
||||
"pesign",
|
||||
"pkgconf",
|
||||
"pkgconf-m4",
|
||||
"pkgconf-pkg-config",
|
||||
"redhat-rpm-config",
|
||||
"rpm",
|
||||
"rpm-build",
|
||||
"rpm-sign",
|
||||
"rpmdevtools",
|
||||
"rpmlint",
|
||||
"source-highlight",
|
||||
"strace",
|
||||
"systemtap",
|
||||
"tar",
|
||||
"valgrind",
|
||||
"valgrind-devel",
|
||||
]
|
||||
scripts_final = [
|
||||
"dnf clean all",
|
||||
"rm -rf /var/cache/dnf"
|
||||
]
|
||||
10
library/locals.pkr.hcl
Normal file
10
library/locals.pkr.hcl
Normal file
@ -0,0 +1,10 @@
|
||||
locals {
|
||||
build_name = "${var.os_name}_${var.os_version_full}_${var.os_image}"
|
||||
sources = [
|
||||
var.use_docker ? "source.docker.os" : null,
|
||||
var.use_incus ? "source.incus.os" : null
|
||||
]
|
||||
incus_base_name = "${var.os_name}${var.os_version_major}/${var.os_image}"
|
||||
incus_output_image = "${local.incus_base_name}/${var.suffix}"
|
||||
is_master = "${var.git_branch}" == "master"
|
||||
}
|
||||
12
library/plugins.pkr.hcl
Normal file
12
library/plugins.pkr.hcl
Normal file
@ -0,0 +1,12 @@
|
||||
packer {
|
||||
required_plugins {
|
||||
docker = {
|
||||
version = ">= 1.1.1"
|
||||
source = "github.com/hashicorp/docker"
|
||||
}
|
||||
incus = {
|
||||
source = "github.com/bketelsen/incus"
|
||||
version = "~> 1"
|
||||
}
|
||||
}
|
||||
}
|
||||
11
library/sources.pkr.hcl
Normal file
11
library/sources.pkr.hcl
Normal file
@ -0,0 +1,11 @@
|
||||
source "docker" "os" {
|
||||
image = var.docker_source
|
||||
commit = true
|
||||
changes = var.docker_changes
|
||||
}
|
||||
|
||||
source "incus" "os" {
|
||||
image = var.incus_source
|
||||
output_image = local.incus_output_image
|
||||
publish_remote_name = "local"
|
||||
}
|
||||
118
library/variables.pkr.hcl
Normal file
118
library/variables.pkr.hcl
Normal file
@ -0,0 +1,118 @@
|
||||
variable "use_docker" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
variable "use_incus" {
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
variable "os_name" {
|
||||
description = "The name of the operating system."
|
||||
type = string
|
||||
default = env("OS_NAME")
|
||||
}
|
||||
variable "os_version_full" {
|
||||
description = "The operating system full version number."
|
||||
type = string
|
||||
default = env("OS_VERSION_FULL")
|
||||
}
|
||||
variable "os_image" {
|
||||
description = "The type of image to be built."
|
||||
type = string
|
||||
default = env("OS_IMAGE")
|
||||
}
|
||||
variable "os_version_major" {
|
||||
description = "The operating system major version number."
|
||||
type = string
|
||||
default = env("OS_VERSION_MAJOR")
|
||||
}
|
||||
variable "date" {
|
||||
description = "The current date in yyymmdd format."
|
||||
type = string
|
||||
default = env("DATE")
|
||||
}
|
||||
variable "packages" {
|
||||
description = "List of packages to install."
|
||||
type = list(string)
|
||||
default = ["git"]
|
||||
}
|
||||
variable "scripts_pre_file_copy" {
|
||||
description = "Scripts to run before the file copy process."
|
||||
type = list(string)
|
||||
default = ["true"]
|
||||
}
|
||||
variable "scripts_post_file_copy" {
|
||||
description = "Scripts to run after the file copy process."
|
||||
type = list(string)
|
||||
default = ["true"]
|
||||
}
|
||||
variable "scripts_pre_packages" {
|
||||
description = "Scripts to run before the package install process."
|
||||
type = list(string)
|
||||
default = ["true"]
|
||||
}
|
||||
variable "scripts_post_packages" {
|
||||
description = "Scripts to run after the package install process."
|
||||
type = list(string)
|
||||
default = ["true"]
|
||||
}
|
||||
variable "scripts_final" {
|
||||
description = "Scripts to run at the end of the build process."
|
||||
type = list(string)
|
||||
default = ["true"]
|
||||
}
|
||||
variable "deploy_files_from_image" {
|
||||
description = "Whether to deploy files from images directory."
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
variable "deploy_files_from_common" {
|
||||
description = "Whether to deploy files from the common os name/image path."
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
variable "docker_username" {
|
||||
description = "The username to use when logging into docker registry."
|
||||
type = string
|
||||
default = env("DOCKER_USERNAME")
|
||||
}
|
||||
variable "docker_password" {
|
||||
description = "The password to use when logging into docker registry."
|
||||
type = string
|
||||
default = env("DOCKER_PASSWORD")
|
||||
}
|
||||
variable "docker_server" {
|
||||
description = "The docker registry to login to."
|
||||
type = string
|
||||
default = env("DOCKER_SERVER")
|
||||
}
|
||||
variable "docker_changes" {
|
||||
description = "A list of metadata changes, e.g. CMD, WORKDIR, ENV, etc."
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
variable "docker_source" {
|
||||
description = "The docker_source image for the build."
|
||||
type = string
|
||||
default = env("DOCKER_SOURCE")
|
||||
}
|
||||
variable "incus_source" {
|
||||
description = "The incus_source image for the build."
|
||||
type = string
|
||||
default = env("INCUS_SOURCE")
|
||||
}
|
||||
variable "incus_output_image" {
|
||||
description = "The output image name for incus images for the build."
|
||||
type = string
|
||||
default = env("INCUS_OUTPUT_IMAGE")
|
||||
}
|
||||
variable "suffix" {
|
||||
description = "The output image suffix. This should be unique per-run."
|
||||
type = string
|
||||
default = env("SUFFIX")
|
||||
}
|
||||
variable "git_branch" {
|
||||
description = "The current git branch."
|
||||
type = string
|
||||
default = env("GIT_BRANCH")
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user