diff --git a/.gitlab-ci/b2c/b2c.yml.jinja2.jinja2 b/.gitlab-ci/b2c/b2c.yml.jinja2.jinja2 index e70f810463c..8df066f60c2 100644 --- a/.gitlab-ci/b2c/b2c.yml.jinja2.jinja2 +++ b/.gitlab-ci/b2c/b2c.yml.jinja2.jinja2 @@ -70,6 +70,32 @@ deployment: # Initial boot start: storage: +{% if imagestore_platform %} + imagestore: + public: + # List of images that should be pulled into the image store ahead of execution + images: + mars: + name: "{{ machine_registration_image }}" + platform: "{{ imagestore_platform }}" + tls_verify: false + {% set machine_registration_image="{% raw %}{{ job.imagestore.public.mars.image_id }}{% endraw %}" %} + telegraf: + name: "{{ telegraf_image }}" + platform: "{{ imagestore_platform }}" + tls_verify: false + {% set telegraf_image="{% raw %}{{ job.imagestore.public.telegraf.image_id }}{% endraw %}" %} + image_under_test: + name: "{{ image_under_test }}" + platform: "{{ imagestore_platform }}" + tls_verify: false + {% set image_under_test="{% raw %}{{ job.imagestore.public.image_under_test.image_id }}{% endraw %}" %} + nbd: + storage: + max_connections: 5 + size: 10G +{% endif %} + http: - path: "/b2c-extra-args" data: > @@ -79,9 +105,9 @@ deployment: {% for volume in volumes %} b2c.volume={{ volume }} {% endfor %} - b2c.run_service="--privileged --tls-verify=false --pid=host docker://{{ '{{' }} fdo_proxy_registry }}/gfx-ci/ci-tron/telegraf:latest" b2c.hostname=dut-{{ '{{' }} machine.full_name }} - b2c.run="-ti --tls-verify=false docker://{{ '{{' }} fdo_proxy_registry }}/gfx-ci/ci-tron/machine-registration:latest check" - b2c.run="-v {{ '{{' }} job_bucket }}-results:{{ working_dir }} -w {{ working_dir }} {% for mount_volume in mount_volumes %} -v {{ mount_volume }}{% endfor %} --tls-verify=false docker://{{ local_container }} {{ container_cmd | replace('"', '\\\"') }}" + b2c.run_service="--privileged --tls-verify=false --pid=host {{ telegraf_image }}" b2c.hostname=dut-{{ '{{' }} machine.full_name }} + b2c.run="-ti --tls-verify=false {{ machine_registration_image }} check" + b2c.run="-v {{ '{{' }} job_bucket }}-results:{{ working_dir }} -w {{ working_dir }} {% for mount_volume in mount_volumes %} -v {{ mount_volume }}{% endfor %} --tls-verify=false {{image_under_test}} {{ container_cmd | replace('"', '\\\"') }}" kernel: {% if kernel_url %} url: '{{ kernel_url }}' @@ -92,8 +118,16 @@ deployment: cmdline: > SALAD.machine_id={{ '{{' }} machine_id }} console={{ '{{' }} local_tty_device }},115200 - b2c.cache_device=auto b2c.ntp_peer=10.42.0.1 + b2c.ntp_peer=10.42.0.1 b2c.extra_args_url={{ '{{' }} job.http.url }}/b2c-extra-args + {% if imagestore_platform is defined %} + {{ '{{' }} imagestore.mount("public").nfs.to_b2c_filesystem("publicimgstore") }} + b2c.storage="additionalimagestores=publicimgstore" + b2c.nbd=/dev/nbd0,host=ci-gateway,port={% raw %}{{ '{{' }} job.nbd.storage.tcp_port }}{% endraw %},connections=5 + b2c.cache_device=/dev/nbd0 + {% else %} + b2c.cache_device=auto + {% endif %} {% if kernel_cmdline_extras is defined %} {{ kernel_cmdline_extras }} {% endif %} diff --git a/.gitlab-ci/b2c/generate_b2c.py b/.gitlab-ci/b2c/generate_b2c.py index fea12dcf192..b4d75dc8daf 100755 --- a/.gitlab-ci/b2c/generate_b2c.py +++ b/.gitlab-ci/b2c/generate_b2c.py @@ -41,12 +41,16 @@ values['ci_runner_description'] = environ['CI_RUNNER_DESCRIPTION'] values['job_volume_exclusions'] = [excl for excl in values['job_volume_exclusions'].split(",") if excl] values['working_dir'] = environ['CI_PROJECT_DIR'] -# Use the gateway's pull-through registry caches to reduce load on fd.o. -values['local_container'] = environ['IMAGE_UNDER_TEST'] -values['local_container'] = values['local_container'].replace( - 'registry.freedesktop.org', - '{{ fdo_proxy_registry }}' -) +values['image_under_test'] = environ['IMAGE_UNDER_TEST'] +values['machine_registration_image'] = environ.get('MACHINE_REGISTRATION_IMAGE', "registry.freedesktop.org/gfx-ci/ci-tron/machine-registration:latest") +values['telegraf_image'] = environ.get('TELEGRAF_IMAGE', "registry.freedesktop.org/gfx-ci/ci-tron/telegraf:latest") + +# Pull all our images through our proxy registry +for image in ['image_under_test', 'machine_registration_image', 'telegraf_image']: + values[image] = values[image].replace( + 'registry.freedesktop.org', + '{{ fdo_proxy_registry }}' + ) if 'kernel_cmdline_extras' not in values: values['kernel_cmdline_extras'] = ''