Skip to content

Commit 3dff1ce

Browse files
committed
Add core services for iop
Signed-off-by: Eric D. Helms <[email protected]>
1 parent adfc046 commit 3dff1ce

File tree

38 files changed

+1150
-1
lines changed

38 files changed

+1150
-1
lines changed

.github/workflows/test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,72 @@ jobs:
121121
uses: re-actors/alls-green@release/v1
122122
with:
123123
jobs: ${{ toJSON(needs) }}
124+
125+
iop-tests:
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
certificate_source:
130+
- default
131+
- installer
132+
runs-on: ubuntu-24.04
133+
steps:
134+
- uses: actions/checkout@v5
135+
- name: Set up Python
136+
uses: actions/setup-python@v6
137+
with:
138+
python-version: '3.12'
139+
- name: Setup libvirt for Vagrant
140+
uses: voxpupuli/setup-vagrant@v0
141+
- name: Install Ansible
142+
run: pip install --upgrade ansible-core
143+
- name: Setup environment
144+
run: ./setup-environment
145+
- name: Start VMs
146+
run: |
147+
./forge vms start
148+
- name: Configure repositories
149+
run: |
150+
./forge setup-repositories
151+
- name: Create installer certificates
152+
if: contains(matrix.certificate_source, 'installer')
153+
run: |
154+
./forge installer-certs
155+
- name: Run image pull
156+
run: |
157+
./foremanctl pull-images
158+
- name: Run deployment
159+
run: |
160+
./foremanctl deploy --enable-iop true --certificate-source=${{ matrix.certificate_source }} --foreman-initial-admin-password=changeme
161+
- name: Setup hammer
162+
run: |
163+
./foremanctl setup-hammer
164+
- name: Run tests
165+
run: |
166+
./forge test --pytest-args="--certificate-source=${{ matrix.certificate_source }}"
167+
- name: Run smoker
168+
run: |
169+
./forge smoker
170+
- name: Archive smoker report
171+
if: ${{ always() }}
172+
uses: actions/upload-artifact@v5
173+
with:
174+
name: smoker-iop-${{ matrix.certificate_source }}
175+
path: "/home/runner/smoker/report/"
176+
- name: Generate sos reports
177+
if: ${{ always() }}
178+
run: ./forge sos
179+
- name: Archive sos reports
180+
if: ${{ always() }}
181+
uses: actions/upload-artifact@v5
182+
with:
183+
name: sosreport-iop-${{ matrix.certificate_source }}
184+
path: sos/
185+
- name: Setup upterm session
186+
if: ${{ failure() }}
187+
uses: owenthereal/action-upterm@v1
188+
with:
189+
## limits ssh access and adds the ssh public key for the user which triggered the workflow
190+
limit-access-to-actor: true
191+
## If no one connects after 5 minutes, shut down server.
192+
wait-timeout-minutes: 5

development/ansible.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
host_key_checking = False
33
stdout_callback=debug
44
stderr_callback=debug
5-
roles_path = ./roles
5+
roles_path = ./roles:../src/roles
66
display_skipped_hosts = no

docs/parameters.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ There are multiple use cases from the users perspective that dictate what parame
5151
| `--foreman-initial-admin-password` | Initial password for the admin user | `--foreman-initial-admin-password` |
5252
| `--foreman-puma-workers` | Number of workers for Puma | `--foreman-foreman-service-puma-workers` |
5353

54+
#### IOP
55+
56+
##### Mapped
57+
58+
| Parameter | Description | foreman-installer Parameters |
59+
| ----------| ----------- | ---------------------------- |
60+
| `--enable-iop` | Enable deployment of IOP services | `--enable-iop` |
61+
5462
#### Certs
5563

5664
##### Mapped

src/playbooks/deploy/deploy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@
5454
- pulp
5555
- foreman
5656
- role: systemd_target
57+
- role: iop_core
58+
when: enable_iop | bool
5759
- post_install

src/playbooks/deploy/metadata.obsah.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ variables:
99
help: Initial password for the admin user.
1010
foreman_puma_workers:
1111
help: Number of workers for Puma.
12+
enable_iop:
13+
help: Enable deployment of IOP services.
1214

1315
include:
1416
- _certificate_source

src/roles/iop_core/tasks/main.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
- name: Deploy IOP Kafka service
3+
ansible.builtin.include_role:
4+
name: iop_kafka
5+
6+
- name: Deploy IOP Ingress service
7+
ansible.builtin.include_role:
8+
name: iop_ingress
9+
10+
- name: Deploy IOP Gateway service
11+
ansible.builtin.include_role:
12+
name: iop_gateway
13+
14+
- name: Deploy IOP Puptoo service
15+
ansible.builtin.include_role:
16+
name: iop_puptoo
17+
18+
- name: Deploy IOP Yuptoo service
19+
ansible.builtin.include_role:
20+
name: iop_yuptoo
21+
22+
- name: Deploy IOP Engine service
23+
ansible.builtin.include_role:
24+
name: iop_engine
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
iop_engine_container_image: "quay.io/iop/insights-engine"
3+
iop_engine_container_tag: "latest"
4+
5+
iop_engine_packages:
6+
- "insights.specs.default"
7+
- "insights.specs.insights_archive"
8+
- "insights_kafka_service.rules"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
- name: Check if engine service exists
3+
ansible.builtin.systemd:
4+
name: iop-core-engine
5+
register: engine_service_status
6+
failed_when: false
7+
listen: restart engine
8+
9+
- name: Restart engine service if it exists
10+
ansible.builtin.systemd:
11+
name: iop-core-engine
12+
state: restarted
13+
when: engine_service_status.status is defined and engine_service_status.status.LoadState != "not-found"
14+
listen: restart engine
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
- name: Pull Engine container image
3+
containers.podman.podman_image:
4+
name: "{{ iop_engine_container_image }}:{{ iop_engine_container_tag }}"
5+
state: present
6+
7+
- name: Create Engine config secret
8+
containers.podman.podman_secret:
9+
state: present
10+
name: iop-core-engine-config-yml
11+
data: "{{ lookup('ansible.builtin.template', 'engine/config.yml.j2') }}"
12+
notify: restart engine
13+
14+
- name: Deploy Engine container
15+
containers.podman.podman_container:
16+
name: iop-core-engine
17+
image: "{{ iop_engine_container_image }}:{{ iop_engine_container_tag }}"
18+
state: quadlet
19+
network: host
20+
command: insights-core-engine /var/config.yml
21+
secrets:
22+
- 'iop-core-engine-config-yml,target=/var/config.yml,mode=0440,uid=1000,type=mount'
23+
etc_hosts:
24+
console.redhat.com: "127.0.0.1"
25+
quadlet_options:
26+
- |
27+
[Unit]
28+
Description=IOP Core Engine Container
29+
After=iop-core-kafka.service iop-core-ingress.service
30+
Wants=iop-core-kafka.service iop-core-ingress.service
31+
[Service]
32+
Restart=on-failure
33+
[Install]
34+
WantedBy=default.target
35+
36+
- name: Run daemon reload to make Quadlet create the service files
37+
ansible.builtin.systemd:
38+
daemon_reload: true
39+
40+
- name: Start Engine service
41+
ansible.builtin.systemd:
42+
name: iop-core-engine
43+
enabled: true
44+
state: started
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins:
2+
default_component_enabled: true
3+
packages:
4+
{% for package in iop_engine_packages %}
5+
- {{ package }}
6+
{% endfor %}
7+
configs: []
8+
service:
9+
extract_timeout: 10
10+
unpacked_archive_size_limit: 1800000000
11+
extract_tmp_dir:
12+
format: insights_kafka_service.formats._insights.InsightsFormat
13+
target_components: []
14+
consumer:
15+
name: "insights_kafka_service.consumer.InsightsKafkaConsumer"
16+
kwargs:
17+
services:
18+
- "advisor"
19+
group_id: "insights-core-kafka"
20+
queued.max.messages.kbytes: 10000
21+
session.timeout.ms: 30000
22+
max.poll.interval.ms: 600000
23+
bootstrap_servers:
24+
- "localhost:9092"
25+
incoming_topic: platform.inventory.events
26+
publisher:
27+
name: "insights_kafka_service.producer.InsightsKafkaProducer"
28+
kwargs:
29+
bootstrap_servers:
30+
- "localhost:9092"
31+
topic: platform.engine.results
32+
downloader:
33+
name: "insights_messaging.downloaders.httpfs.Http"

0 commit comments

Comments
 (0)