Skip to content
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

Candlepin service running via a systemd container #121

Closed
wants to merge 1 commit into from

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Nov 16, 2018

This requires a few other changes to go in to work that have open PRs. The idea is to introduce a candlepin service that runs a container via podman. This introduces a new paramter to switch to this mode. One downside is that this creates two service paths: tomcat service and Candlepin service. I debated first migrating to a Candlepin service that starts tomcat for non-container installs so there is one service with two implementations but wanted to see what others thought first.

Dependent PRs:

@ehelms ehelms force-pushed the candlepin-as-container branch 2 times, most recently from ed586a3 to e833edf Compare November 19, 2018 18:41
@ehelms
Copy link
Member Author

ehelms commented Nov 20, 2018

Current playbook to test this with existing open PRs:

---
- hosts: all
  become: true
  vars:
    foreman_installer_module_branches:
      - ehelms/candlepin/candlepin-as-container
      - ehelms/certs/candlepin-ca-default
      - ehelms/katello/move-keystore
  pre_tasks:
    - name: 'Make dir'
      file:
        state: directory
        path: /etc/foreman-installer

    - name: 'Deploy custom-hiera'
      copy:
        dest: /etc/foreman-installer/custom-hiera.yaml
        content: |
          candlepin::container: true
  roles:
    - role: katello

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces please :)

manifests/service.pp Outdated Show resolved Hide resolved
manifests/service.pp Outdated Show resolved Hide resolved
manifests/service.pp Outdated Show resolved Hide resolved
manifests/service.pp Outdated Show resolved Hide resolved
manifests/service.pp Outdated Show resolved Hide resolved
manifests/service.pp Outdated Show resolved Hide resolved
templates/candlepin.conf.erb Outdated Show resolved Hide resolved
manifests/service.pp Outdated Show resolved Hide resolved
@ehelms ehelms force-pushed the candlepin-as-container branch 2 times, most recently from bc42d54 to 9e4cfc6 Compare November 27, 2018 13:58
@ehelms ehelms changed the title [WIP] Candlepin service running via a systemd container Candlepin service running via a systemd container Nov 27, 2018
@ehelms ehelms force-pushed the candlepin-as-container branch 2 times, most recently from 8e754ca to 13d2ec6 Compare November 27, 2018 14:45
@ehelms
Copy link
Member Author

ehelms commented Nov 27, 2018

Updated

@ehelms ehelms force-pushed the candlepin-as-container branch 2 times, most recently from eacec5b to 6d6f946 Compare November 27, 2018 18:23
templates/candlepin.service.erb Outdated Show resolved Hide resolved
manifests/params.pp Outdated Show resolved Hide resolved
templates/candlepin.service.erb Outdated Show resolved Hide resolved
templates/candlepin.sysconfig.erb Outdated Show resolved Hide resolved
@ehelms ehelms force-pushed the candlepin-as-container branch from 6d6f946 to 12946fc Compare November 30, 2018 01:25
@ehelms
Copy link
Member Author

ehelms commented Nov 30, 2018

I moved the pull into the install.pp manifest and added both container_version and container_image parameters to help with configuration.

@ehelms ehelms force-pushed the candlepin-as-container branch from 12946fc to 40ca59c Compare November 30, 2018 01:37
@ehelms ehelms force-pushed the candlepin-as-container branch from 40ca59c to 2913364 Compare December 3, 2018 20:36
Copy link
Member

@sean797 sean797 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 👍

@ehelms ehelms force-pushed the candlepin-as-container branch from 2913364 to f3d10b5 Compare January 2, 2019 13:43
Copy link

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, is podman available on all platforms we support? Forgot Katello only supports EL7 based distributions, nevermind.

ExecStartPre=-/usr/bin/podman rm "candlepin-1"
ExecStart=/usr/bin/podman run --name candlepin-1 --env-file /etc/sysconfig/candlepin --net host -v /etc/candlepin:/etc/candlepin:z -v /etc/tomcat:/etc/tomcat:z -p <%= scope['candlepin::ssl_port'] %> <%= scope['candlepin::container_image'] %>:<%= scope['candlepin::container_version'] %>
ExecReload=-/usr/bin/podman stop "candlepin-1"
ExecReload=-/usr/bin/podman rm "candlepin-1"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't reload be used for "make the service reload its configuration without stopping it" kind of thing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you make any configuration changes on disk, or environment variables you have to stop the container and re-start to pick up the new. I could be wrong though :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds more like restart and reload should simply not be implemented then.

@ehelms ehelms closed this Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants