first commit
This commit is contained in:
@@ -37,6 +37,12 @@ Pull manuale:
|
||||
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
|
||||
|
||||
```bash
|
||||
|
||||
@@ -39,5 +39,5 @@
|
||||
- "Deploy completato"
|
||||
- "URL: http://{{ ansible_host }}:{{ app_port }}"
|
||||
- "Container: {{ container_name }}"
|
||||
- "Image: {{ container_image }}:{{ image_tag }}"
|
||||
- "Image: {{ container_image_ref }}"
|
||||
- "Digest atteso: sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab"
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
registry_url: gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu
|
||||
repository_name: j.r/application-consumption-demo-algorithm
|
||||
image_tag: optimized
|
||||
image_digest: "sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab"
|
||||
image_platform: "linux/amd64"
|
||||
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
|
||||
|
||||
# App settings
|
||||
|
||||
@@ -28,6 +28,8 @@ environment_variables:
|
||||
registry_url: "gitea.dataprovider01.sandbox-cat-dat.simpl-europe.eu"
|
||||
repository_name: "j.r/application-consumption-demo-algorithm"
|
||||
image_tag: "optimized"
|
||||
image_digest: "sha256:6cc8ab7c08f195cb65c689255418652fdf0094acaaa4ef63475d594039cda2ab"
|
||||
image_platform: "linux/amd64"
|
||||
|
||||
greeting_message: "Hello from SemaphoreUI Demo"
|
||||
enable_health_check: "true"
|
||||
|
||||
@@ -16,16 +16,26 @@
|
||||
name: "{{ container_name }}"
|
||||
state: absent
|
||||
|
||||
- name: Scarica immagine ML app
|
||||
community.docker.docker_image:
|
||||
name: "{{ container_image }}"
|
||||
tag: "{{ image_tag }}"
|
||||
source: pull
|
||||
- name: Scarica immagine ML app (platform-aware)
|
||||
block:
|
||||
- name: Pull immagine Docker da registry
|
||||
ansible.builtin.command: >-
|
||||
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
|
||||
community.docker.docker_container:
|
||||
name: "{{ container_name }}"
|
||||
image: "{{ container_image }}:{{ image_tag }}"
|
||||
image: "{{ container_image_ref }}"
|
||||
state: started
|
||||
restart_policy: unless-stopped
|
||||
ports:
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
|
||||
- name: Rimuovi immagine (opzionale)
|
||||
community.docker.docker_image:
|
||||
name: "{{ container_image }}"
|
||||
tag: "{{ image_tag }}"
|
||||
name: "{{ container_image_ref }}"
|
||||
state: absent
|
||||
when: remove_image | bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user