-
Notifications
You must be signed in to change notification settings - Fork 23
Share built image with other projects #1631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stackhpc/2024.1
Are you sure you want to change the base?
Conversation
|
||
# Accept the image in the receiving project | ||
- name: Accept image membership in stackhpc-dev project | ||
command: "{{ ansible_python_interpreter | dirname | dirname }}/bin/openstack image set {{ image.image.id }} --project '{{ lookup('ansible.builtin.env', 'HOST_IMAGE_BUILD_SHARE_PROJECT_ID') }}' --accept" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command: "{{ ansible_python_interpreter | dirname | dirname }}/bin/openstack image set {{ image.image.id }} --project '{{ lookup('ansible.builtin.env', 'HOST_IMAGE_BUILD_SHARE_PROJECT_ID') }}' --accept" | |
ansible.builtin.command: "{{ ansible_python_interpreter | dirname | dirname }}/bin/openstack image set {{ image.image.id }} --project '{{ lookup('ansible.builtin.env', 'HOST_IMAGE_BUILD_SHARE_PROJECT_ID') }}' --accept" |
visibility: shared | ||
register: image | ||
|
||
- name: Ensure dependencies are installed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be integrated into the previous pip task here?
|
||
# Add the image to the chosen project | ||
- name: Add image to stackhpc-dev project | ||
command: "{{ ansible_python_interpreter | dirname | dirname }}/bin/openstack image add project {{ image.image.id }} '{{ lookup('ansible.builtin.env', 'HOST_IMAGE_BUILD_SHARE_PROJECT_ID') }}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
command: "{{ ansible_python_interpreter | dirname | dirname }}/bin/openstack image add project {{ image.image.id }} '{{ lookup('ansible.builtin.env', 'HOST_IMAGE_BUILD_SHARE_PROJECT_ID') }}'" | |
ansible.builtin.command: "{{ ansible_python_interpreter | dirname | dirname }}/bin/openstack image add project {{ image.image.id }} '{{ lookup('ansible.builtin.env', 'HOST_IMAGE_BUILD_SHARE_PROJECT_ID') }}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea but why not just setting the visibility of built images to public, so the new images could be used in all projects in both dev clouds?
register: image | ||
|
||
- name: Ensure dependencies are installed | ||
pip: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip: | |
ansible.builtin.pip: |
Agree for SMS but can't really do that on leafcloud |
Ah that's correct |
In addition to uploading the image to both SMS and LeafCloud this PR enables the images to be shared between the current CI Project and the project ID provided as environment variables
HOST_IMAGE_BUILD_SHARE_PROJECT_ID
&HOST_IMAGE_BUILD_SHARE_PROJECT_ID_OTHER_CLOUD
.