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

Ability to run locally with Docker #155

Open
ghoneycutt opened this issue Apr 28, 2023 · 4 comments
Open

Ability to run locally with Docker #155

ghoneycutt opened this issue Apr 28, 2023 · 4 comments
Labels
community enhancement New feature or request

Comments

@ghoneycutt
Copy link

As a new HDM user, I would like to have a very prescribed way to put my hiera data in a specific location, start a container and begin using HDM.

I am interested in helping developers run this locally against their checked out control repos so they can make contributions and the prescribed work flow with docker would allow this. Would also make it much easier to start using it against your own data to evaluate the software.

@tuxmea
Copy link
Member

tuxmea commented Apr 29, 2023

We already discussed this internally and postponed this scenario to a later release as we saw lots of discussion.

At the moment HDM requires a fully deployed puppet code base using r10k or code manager and access to PuppetDB.

Available environments are read from PuppetDB and filesystem.
Node facts and their last used environment are read from PuppetDB.
This allows us to parse the hiera.yaml file and identify used hierarchy files.

If we run on local control-repo: How should HDM get nodes and their facts so it is able to render the hiera.yaml hierarchies?

@tuxmea tuxmea added enhancement New feature or request community labels Apr 29, 2023
@tuxmea
Copy link
Member

tuxmea commented Jun 15, 2023

Comment from @oneiros : for testing we use the fake puppetdb service and we use local data.
We can check if this is a way also for local development.

@oneiros
Copy link
Collaborator

oneiros commented Jun 20, 2023

To elaborate on this:

If I understand #154 and this correctly, you want to run hdm locally on static files (your control repo for hiera data and json/yaml files with the nodes' facts).

This can be achieved today without Docker roughly in this way:

  1. Clone the hdm repository and follow the instructions for a manual, non-Docker installation.
  2. Copy your environments' files from the control repository to test/fixtures/files/puppet/environments/<environment_name>.
  3. For every node place the output of facter -p -y into a file test/fixtures/files/puppet/nodes/<fqdn>_facts.yaml
  4. Run bin/fake_puppet_db and edit your config/hdm.yml to use it instead of puppetdb:
    puppet_db:
      server: http://localhost:8083

This would "repurpose" the fake puppetdb service we created for development and testing. If this is a viable use case for hdm I think we could improve two things:

First we could improve the fake puppetdb service to take a configuration option setting the directory where it looks for files. This way, you would not have to mix your development data with our test data.

The second thing would be to improve the situation for Docker users. I am no expert here and thus not sure what would be convenient and reasonably easy to implement. Maybe a second Dockerfile for the fake puppetdb service? And maybe a docker compose file?

@tuxmea
Copy link
Member

tuxmea commented Nov 2, 2023

@ghoneycutt any feedback from your side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants