forked from alt/image-forge
Compare commits
6 Commits
test_workf
...
c10f2-patc
Author | SHA1 | Date | |
---|---|---|---|
af7b730c4b | |||
941b8fb599 | |||
aacaf22d79 | |||
2d5df6ea4c | |||
626b6feb4c | |||
69e7c13ea2 |
@ -43,6 +43,17 @@ jobs:
|
||||
org=$(echo $EV | jq '.ref' -r | sed 's/refs\/tags\///g' | cut -d '_' -f 2)
|
||||
echo "ORG=$org" >> ${GITHUB_ENV}
|
||||
echo "ORG=$org"
|
||||
- name: Check out current repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Change vendor label for c10f
|
||||
if: ${{ contains(github.ref_name, 'c10f') }}
|
||||
run: |
|
||||
echo "sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/Dockerfile.template ||:"
|
||||
sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/Dockerfile.template ||:
|
||||
echo "sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/distroless.toml ||:"
|
||||
sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/distroless.toml ||:
|
||||
env:
|
||||
ORG: ${{ env.ORG }}
|
||||
- name: Set repo for c10f2 (Temporary)
|
||||
if: ${{ contains(github.ref_name, 'c10f2') }}
|
||||
run: |
|
||||
@ -50,8 +61,6 @@ jobs:
|
||||
echo "10.4.0.3 update.altsp.su" >> /etc/hosts
|
||||
echo "cat /etc/hosts"
|
||||
cat /etc/hosts
|
||||
- name: Check out current repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Login podman gitea
|
||||
run: |
|
||||
echo "podman login ${{ env.URL }}"
|
||||
|
@ -43,6 +43,15 @@ jobs:
|
||||
apt-get install -y qemu-user-static-binfmt-aarch64 qemu-user-static-binfmt-arm qemu-user-static-binfmt-ppc qemu-user-static-binfmt-riscv qemu-user-static-binfmt-loongarch
|
||||
- name: Check out current repo
|
||||
uses: actions/checkout@v4
|
||||
- name: Change vendor label for c10f
|
||||
if: ${{ contains(github.ref_name, 'c10f') }}
|
||||
run: |
|
||||
echo "sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/Dockerfile.template ||:"
|
||||
sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/Dockerfile.template ||:
|
||||
echo "sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/distroless.toml ||:"
|
||||
sed -i 's/ALT Linux Team/BaseALT LLC/g' ${{ gitea.workspace }}/org/$ORG/*/distroless.toml ||:
|
||||
env:
|
||||
ORG: ${{ env.ORG }}
|
||||
- name: Login podman gitea
|
||||
run: |
|
||||
echo "podman login ${{ env.URL }}"
|
||||
|
11
README.md
11
README.md
@ -86,7 +86,7 @@ source_packages:
|
||||
./build.py -i k8s/pause
|
||||
```
|
||||
|
||||
#### org/alt/etcd
|
||||
#### org/k8s/etcd
|
||||
|
||||
```yaml
|
||||
is_versioned: true
|
||||
@ -95,16 +95,11 @@ version_template:
|
||||
- "{{ version }}"
|
||||
- "{{ version }}-0"
|
||||
source_packages:
|
||||
- >
|
||||
{% if branch in ["sisyphus", "p11"] %}
|
||||
{% raw %}etcd{{ version }}{% endraw %}
|
||||
{% else %}
|
||||
etcd
|
||||
{% endif %}
|
||||
- etcd-for-kubernetes{{ version }}
|
||||
```
|
||||
|
||||
```bash
|
||||
./build.py -b sisyphus -i alt/etcd --package-version '{"alt/etcd": "3.5.15"}'
|
||||
./build.py -b sisyphus -i k8s/etcd --package-version '{"k8s/etcd": "1.32"}'
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
17
build.py
17
build.py
@ -11,6 +11,7 @@ from datetime import datetime
|
||||
from dataclasses import dataclass
|
||||
from graphlib import TopologicalSorter
|
||||
from pathlib import Path
|
||||
from typing import Optional, Union
|
||||
|
||||
import requests
|
||||
import tomli
|
||||
@ -21,7 +22,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
ORG_DIR = Path("org")
|
||||
|
||||
PKG_VERSIONS: dict | None = None
|
||||
PKG_VERSIONS: Optional[dict] = None
|
||||
|
||||
# Jinja2 custom fail filter
|
||||
def fail(message: str):
|
||||
@ -33,9 +34,9 @@ JINJA_ENV.filters['fail'] = fail
|
||||
@dataclass
|
||||
class Image:
|
||||
canonical_name: str
|
||||
is_versioned: bool | None
|
||||
version_template: list[str] | str | None
|
||||
source_packages: list[str] | None
|
||||
is_versioned: Optional[bool]
|
||||
version_template: Union[list[str], str, None]
|
||||
source_packages: Optional[list[str]]
|
||||
|
||||
def __init__(self, canonical_name: str):
|
||||
self.canonical_name = canonical_name
|
||||
@ -140,14 +141,14 @@ def api_get_source_package_version_from_task(task_id: str, package_name: str):
|
||||
|
||||
|
||||
class Tags:
|
||||
def __init__(self, tags_file: str | None, latest: str):
|
||||
def __init__(self, tags_file: Optional[str], latest: str):
|
||||
if tags_file is None:
|
||||
self._tags = None
|
||||
else:
|
||||
self._tags = tomli.loads(Path(tags_file).read_text())
|
||||
self._latest = latest
|
||||
|
||||
def tags(self, branch: str, image: Image, tasks: Tasks | None = None):
|
||||
def tags(self, branch: str, image: Image, tasks: Optional[Tasks] = None):
|
||||
if self._tags is None:
|
||||
if image.is_versioned is None:
|
||||
tags = [branch]
|
||||
@ -408,9 +409,13 @@ class DockerBuilder:
|
||||
else:
|
||||
registry = ""
|
||||
alt_image = "alt"
|
||||
|
||||
base_image_prefix = "c10f" if self.branch == "c10f2" else self.branch
|
||||
|
||||
rendered = JINJA_ENV.from_string(template).render(
|
||||
alt_image=alt_image,
|
||||
branch=self.branch,
|
||||
base_image_prefix=base_image_prefix,
|
||||
install_packages=install_packages,
|
||||
organization=organization,
|
||||
registry=registry,
|
||||
|
21
org/k8s/etcd/Dockerfile.template
Normal file
21
org/k8s/etcd/Dockerfile.template
Normal file
@ -0,0 +1,21 @@
|
||||
FROM {{ registry }}{{ base_image_prefix }}/{{ alt_image }}:latest
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
LABEL org.opencontainers.image.title="etcd"
|
||||
LABEL org.opencontainers.image.description="Distributed reliable key-value store for the most critical data of a distributed system"
|
||||
LABEL org.opencontainers.image.source="https://github.com/etcd-io/etcd"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="BaseALT LLC"
|
||||
|
||||
ARG PKG_VERSION
|
||||
|
||||
{{ install_packages("etcd-for-kubernetes${PKG_VERSION}") }}
|
||||
|
||||
RUN ln -s /usr/sbin/etcd /usr/local/bin/etcd && ln -s /usr/bin/etcdctl /usr/local/bin/etcdctl
|
||||
|
||||
EXPOSE 2379 2380
|
||||
|
||||
VOLUME /data
|
||||
|
||||
ENTRYPOINT ["/usr/sbin/etcd", "--data-dir", "/data"]
|
19
org/k8s/etcd/README.md
Normal file
19
org/k8s/etcd/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
dockerfiles-alt-etcd
|
||||
=========================
|
||||
|
||||
ALT dockerfile for etcd.
|
||||
|
||||
Copy Dockerfile somewhere and build the image:
|
||||
```console
|
||||
$ podman build --rm -t <username>/etcd.
|
||||
```
|
||||
|
||||
And launch the etcd container:
|
||||
```console
|
||||
$ podman run -d -v <etcd data dir>:/data <username>/etcd
|
||||
```
|
||||
|
||||
If etcdclt is wanted, it could be run via:
|
||||
```console
|
||||
$ podman run --entrypoint etcdctl <username>/etcd
|
||||
```
|
9
org/k8s/etcd/info.yaml
Normal file
9
org/k8s/etcd/info.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
is_versioned: true
|
||||
version_template:
|
||||
- "v{{ version }}"
|
||||
- "{{ version }}"
|
||||
- "{{ version }}-0"
|
||||
source_packages:
|
||||
- etcd-for-kubernetes{{ version }}
|
||||
...
|
1
org/k8s/etcd/test
Normal file
1
org/k8s/etcd/test
Normal file
@ -0,0 +1 @@
|
||||
etcd --version && etcdctl --version
|
@ -1,4 +1,4 @@
|
||||
FROM {{ registry }}{{ branch }}/{{ alt_image }}:latest
|
||||
FROM {{ registry }}{{ base_image_prefix }}/{{ alt_image }}:latest
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
@ -14,4 +14,4 @@ LABEL org.opencontainers.image.title="kube-apiserver"
|
||||
LABEL org.opencontainers.image.description="The Kubernetes API server validates and configures data for the api objects which include pods, services, replicationcontrollers, and others."
|
||||
LABEL org.opencontainers.image.source="https://github.com/kubernetes/kubernetes"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
LABEL org.opencontainers.image.vendor="BaseALT LLC"
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM {{ registry }}{{ branch }}/{{ alt_image }}:latest
|
||||
FROM {{ registry }}{{ base_image_prefix }}/{{ alt_image }}:latest
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
@ -14,4 +14,4 @@ LABEL org.opencontainers.image.title="kube-controller-manager"
|
||||
LABEL org.opencontainers.image.description="The Kubernetes controller manager is a daemon that embeds the core control loops shipped with Kubernetes."
|
||||
LABEL org.opencontainers.image.source="https://github.com/kubernetes/kubernetes"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
LABEL org.opencontainers.image.vendor="BaseALT LLC"
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM {{ registry }}{{ branch }}/{{ alt_image }}:latest
|
||||
FROM {{ registry }}{{ base_image_prefix }}/{{ alt_image }}:latest
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
@ -14,4 +14,4 @@ LABEL org.opencontainers.image.title="kube-proxy"
|
||||
LABEL org.opencontainers.image.description="The Kubernetes network proxy runs on each node."
|
||||
LABEL org.opencontainers.image.source="https://github.com/kubernetes/kubernetes"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
LABEL org.opencontainers.image.vendor="BaseALT LLC"
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM {{ registry }}{{ branch }}/{{ alt_image }}:latest
|
||||
FROM {{ registry }}{{ base_image_prefix }}/{{ alt_image }}:latest
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
@ -14,4 +14,4 @@ LABEL org.opencontainers.image.title="kube-scheduler"
|
||||
LABEL org.opencontainers.image.description="The Kubernetes scheduler is a control plane process which assigns Pods to Nodes."
|
||||
LABEL org.opencontainers.image.source="https://github.com/kubernetes/kubernetes"
|
||||
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
||||
LABEL org.opencontainers.image.vendor="ALT Linux Team"
|
||||
LABEL org.opencontainers.image.vendor="BaseALT LLC"
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM {{ registry }}{{ branch }}/{{ alt_image }}:latest
|
||||
FROM {{ registry }}{{ base_image_prefix }}/{{ alt_image }}:latest
|
||||
|
||||
MAINTAINER alt-cloud
|
||||
|
||||
@ -14,4 +14,4 @@ LABEL org.opencontainers.image.title="kubelet" \
|
||||
org.opencontainers.image.description="An agent that runs on each node in the cluster. It makes sure that containers are running in a Pod." \
|
||||
org.opencontainers.image.source="https://github.com/kubernetes/kubernetes" \
|
||||
org.opencontainers.image.licenses="Apache-2.0" \
|
||||
org.opencontainers.image.vendor="ALT Linux Team" \
|
||||
org.opencontainers.image.vendor="BaseALT LLC"
|
||||
|
Reference in New Issue
Block a user