first commit

This commit is contained in:
Matteo Basile
2026-07-16 08:55:30 +02:00
parent af525dfd06
commit f27f9388e5
6 changed files with 29 additions and 9 deletions

View File

@@ -37,6 +37,12 @@ Pull manuale:
docker pull gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/j.r/application-consumption-demo-algorithm:optimized docker pull gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/j.r/application-consumption-demo-algorithm:optimized
``` ```
Se il nodo target e' amd64 e vedi errore "no matching manifest for linux/amd64":
```bash
docker pull --platform linux/amd64 gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu/j.r/application-consumption-demo-algorithm@sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab
```
## Uso locale rapido ## Uso locale rapido
```bash ```bash

View File

@@ -39,5 +39,5 @@
- "Deploy completato" - "Deploy completato"
- "URL: http://{{ ansible_host }}:{{ app_port }}" - "URL: http://{{ ansible_host }}:{{ app_port }}"
- "Container: {{ container_name }}" - "Container: {{ container_name }}"
- "Image: {{ container_image }}:{{ image_tag }}" - "Image: {{ container_image_ref }}"
- "Digest atteso: sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab" - "Digest atteso: sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab"

View File

@@ -3,7 +3,10 @@
registry_url: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu registry_url: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu
repository_name: j.r/application-consumption-demo-algorithm repository_name: j.r/application-consumption-demo-algorithm
image_tag: optimized image_tag: optimized
image_digest: "sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab"
image_platform: "linux/amd64"
container_image: "{{ registry_url }}/{{ repository_name }}" container_image: "{{ registry_url }}/{{ repository_name }}"
container_image_ref: "{{ container_image ~ ('@' ~ image_digest if (image_digest | default('') | length > 0) else ':' ~ image_tag) }}"
container_name: example-ml-app container_name: example-ml-app
# App settings # App settings

View File

@@ -28,6 +28,8 @@ environment_variables:
registry_url: "gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu" registry_url: "gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu"
repository_name: "j.r/application-consumption-demo-algorithm" repository_name: "j.r/application-consumption-demo-algorithm"
image_tag: "optimized" image_tag: "optimized"
image_digest: "sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab"
image_platform: "linux/amd64"
greeting_message: "Hello from SemaphoreUI Demo" greeting_message: "Hello from SemaphoreUI Demo"
enable_health_check: "true" enable_health_check: "true"

View File

@@ -16,16 +16,26 @@
name: "{{ container_name }}" name: "{{ container_name }}"
state: absent state: absent
- name: Scarica immagine ML app - name: Scarica immagine ML app (platform-aware)
community.docker.docker_image: block:
name: "{{ container_image }}" - name: Pull immagine Docker da registry
tag: "{{ image_tag }}" ansible.builtin.command: >-
source: pull docker pull{% if image_platform | default('') | length > 0 %} --platform {{ image_platform }}{% endif %} {{ container_image_ref }}
register: image_pull
changed_when: image_pull.rc == 0
rescue:
- name: Errore pull immagine con suggerimenti
ansible.builtin.fail:
msg: >-
Pull fallito per {{ container_image_ref }} su platform {{ image_platform | default('default') }}.
Verifica che il registry pubblichi un manifest compatibile con l'architettura host
(esempio linux/amd64) oppure ricostruisci l'immagine come multi-arch.
- name: Avvia container ML app - name: Avvia container ML app
community.docker.docker_container: community.docker.docker_container:
name: "{{ container_name }}" name: "{{ container_name }}"
image: "{{ container_image }}:{{ image_tag }}" image: "{{ container_image_ref }}"
state: started state: started
restart_policy: unless-stopped restart_policy: unless-stopped
ports: ports:

View File

@@ -14,8 +14,7 @@
- name: Rimuovi immagine (opzionale) - name: Rimuovi immagine (opzionale)
community.docker.docker_image: community.docker.docker_image:
name: "{{ container_image }}" name: "{{ container_image_ref }}"
tag: "{{ image_tag }}"
state: absent state: absent
when: remove_image | bool when: remove_image | bool