Update local development for vmpooler 3.0

This commit is contained in:
Jake Spain 2023-02-03 17:07:37 -05:00
parent 9b123644b4
commit c081251826
No known key found for this signature in database
GPG key ID: BC1C4DA0A085E113
7 changed files with 55 additions and 33 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
/*/**/vendor/bundle/ /*/**/vendor/bundle/
/docker/**/vmpooler.yaml /docker/**/vmpooler.yaml
/docker/data/*.json
.vagrant/ .vagrant/
.idea/ .idea/
helm-charts/vmpooler/charts/ helm-charts/vmpooler/charts/

View file

@ -1,16 +1,15 @@
# vmpooler-deployment # vmpooler-deployment
- [vmpooler-deployment](#vmpooler-deployment) - [VMPooler Components](#vmpooler-components)
- [VMPooler Components](#vmpooler-components) - [Docker Registry](#docker-registry)
- [Docker Registry](#docker-registry) - [Helm Repository](#helm-repository)
- [Helm Repository](#helm-repository)
- [Adding / updating charts](#adding--updating-charts) - [Adding / updating charts](#adding--updating-charts)
- [Development](#development) - [Development](#development)
- [Docker Compose URLs](#docker-compose-urls) - [Docker Compose URLs](#docker-compose-urls)
- [Deploy Chart for Testing](#deploy-chart-for-testing) - [Deploy Chart for Testing](#deploy-chart-for-testing)
- [Releasing](#releasing) - [Releasing](#releasing)
- [Contributing](#contributing) - [Contributing](#contributing)
- [License](#license) - [License](#license)
This repo contains Dockerfiles and a Helm chart that can be used to deploy [VMPooler](https://github.com/puppetlabs/vmpooler). The Release Engineering team at Puppet uses the code here as part of operating our VMPooler instances. This repo contains Dockerfiles and a Helm chart that can be used to deploy [VMPooler](https://github.com/puppetlabs/vmpooler). The Release Engineering team at Puppet uses the code here as part of operating our VMPooler instances.
@ -19,6 +18,7 @@ This repo contains Dockerfiles and a Helm chart that can be used to deploy [VMPo
The docker image gnerated and hosted by this project contain the following VMPooler components: The docker image gnerated and hosted by this project contain the following VMPooler components:
- [VMPooler Core](https://github.com/puppetlabs/vmpooler) - [VMPooler Core](https://github.com/puppetlabs/vmpooler)
- [VMPooler Google CloudDNS Plugin](https://github.com/puppetlabs/vmpooler-dns-google-clouddns)
- [VMPooler EC2 Provider](https://github.com/puppetlabs/vmpooler-provider-ec2) - [VMPooler EC2 Provider](https://github.com/puppetlabs/vmpooler-provider-ec2)
- [VMPooler GCE Provider](https://github.com/puppetlabs/vmpooler-provider-gce) - [VMPooler GCE Provider](https://github.com/puppetlabs/vmpooler-provider-gce)
- [VMPooler vSphere Provider](https://github.com/puppetlabs/vmpooler-provider-vsphere) - [VMPooler vSphere Provider](https://github.com/puppetlabs/vmpooler-provider-vsphere)
@ -56,6 +56,8 @@ Prerequisites:
- [vmpooler-provider-ec2](https://github.com/puppetlabs/vmpooler-provider-ec2) - [vmpooler-provider-ec2](https://github.com/puppetlabs/vmpooler-provider-ec2)
- [vmpooler-provider-gce](https://github.com/puppetlabs/vmpooler-provider-gce) - [vmpooler-provider-gce](https://github.com/puppetlabs/vmpooler-provider-gce)
- [vmpooler-provider-vsphere](https://github.com/puppetlabs/vmpooler-provider-vsphere) - [vmpooler-provider-vsphere](https://github.com/puppetlabs/vmpooler-provider-vsphere)
- If you are not using Dynamic DNS, then the following DNS plugins can be used to manage records across different compute providers:
- [VMPooler Google CloudDNS Plugin](https://github.com/puppetlabs/vmpooler-dns-google-clouddns)
2. Chose a Development method: 2. Chose a Development method:
- Develop via local source: - Develop via local source:
1. Clone all of the known vmpooler projects listed at [vmpooler-components](#vmpooler-components) under a common directory, for example: 1. Clone all of the known vmpooler projects listed at [vmpooler-components](#vmpooler-components) under a common directory, for example:
@ -63,6 +65,7 @@ Prerequisites:
```bash ```bash
|-- vmpooler-projects |-- vmpooler-projects
| |--vmpooler-deployment | |--vmpooler-deployment
| |--vmpooler-dns-google-clouddns
| |--vmpooler-provider-ec2 | |--vmpooler-provider-ec2
| |--vmpooler-provider-gce | |--vmpooler-provider-gce
| |--vmpooler-provider-vsphere | |--vmpooler-provider-vsphere
@ -72,10 +75,10 @@ Prerequisites:
3. Run `docker compose -f vmpooler-deployment/docker/docker-compose.local.yml up` 3. Run `docker compose -f vmpooler-deployment/docker/docker-compose.local.yml up`
- Develop via Git source: - Develop via Git source:
1. For the component(s) you are developing on, commit and push changes to a branch. 4. For the component(s) you are developing on, commit and push changes to a branch.
2. Change to the `docker` directory and modify the `Gemfile` as needed to pull the gem(s) from your git branch. 5. Change to the `docker` directory and modify the `Gemfile` as needed to pull the gem(s) from your git branch.
3. Run `./update-gemfile-lock` to update the `Gemfile.lock` 6. Run `./update-gemfile-lock` to update the `Gemfile.lock`
4. Run `docker compose build && docker compose up`. 7. Run `docker compose build && docker compose up`.
When a dependency Helm chart is updated, be sure to run `./update-chart-lock` to update the lockfile, otherwise the test and release workflows will fail. When a dependency Helm chart is updated, be sure to run `./update-chart-lock` to update the lockfile, otherwise the test and release workflows will fail.

View file

@ -25,6 +25,7 @@ RUN apt-get update -qq && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
COPY vmpooler /opt/vmpooler COPY vmpooler /opt/vmpooler
COPY vmpooler-dns-gcp /opt/vmpooler-dns-gcp
COPY vmpooler-provider-ec2 /opt/vmpooler-provider-ec2 COPY vmpooler-provider-ec2 /opt/vmpooler-provider-ec2
COPY vmpooler-provider-gce /opt/vmpooler-provider-gce COPY vmpooler-provider-gce /opt/vmpooler-provider-gce
COPY vmpooler-provider-vsphere /opt/vmpooler-provider-vsphere COPY vmpooler-provider-vsphere /opt/vmpooler-provider-vsphere

View file

@ -1,13 +0,0 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
gem 'vmpooler', '~> 2.5'
# Remove temporarily until a stable minor release is published
# gem 'vmpooler-provider-ec2', '~> 0.0.1'
gem 'vmpooler-provider-gce', '~> 0.5'
gem 'vmpooler-provider-vsphere', '~> 2.1'
# For development install via a git branch use something like:
# gem 'vmpooler', git: 'https://github.com/puppetlabs/vmpooler.git', branch: 'my-feature'
# gem 'vmpooler-provider-ec2', git: 'https://github.com/puppetlabs/vmpooler-provider-ec2.git', branch: 'my-feature'
# gem 'vmpooler-provider-gce', git: 'https://github.com/puppetlabs/vmpooler-provider-gce.git', branch: 'my-feature'
# gem 'vmpooler-provider-vsphere', git: 'https://github.com/puppetlabs/vmpooler-provider-vsphere.git', branch: 'my-feature'

View file

@ -1,6 +1,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org' source ENV['GEM_SOURCE'] || 'https://rubygems.org'
gem 'vmpooler', path: '/opt/vmpooler' gem 'vmpooler', path: '/opt/vmpooler'
gem 'vmpooler-dns-gcp', path: '/opt/vmpooler-dns-gcp'
gem 'vmpooler-provider-ec2', path: '/opt/vmpooler-provider-ec2' gem 'vmpooler-provider-ec2', path: '/opt/vmpooler-provider-ec2'
gem 'vmpooler-provider-gce', path: '/opt/vmpooler-provider-gce' gem 'vmpooler-provider-gce', path: '/opt/vmpooler-provider-gce'
gem 'vmpooler-provider-vsphere', path: '/opt/vmpooler-provider-vsphere' gem 'vmpooler-provider-vsphere', path: '/opt/vmpooler-provider-vsphere'

View file

@ -1,5 +1,18 @@
--- ---
:dns_configs:
ddns_domain: 'dynamic.example.com'
:gcp-clouddns:
project: vmpooler-example
domain: vmpooler.example.com
dns_zone_resource_name: vmpooler-example-com
:providers: :providers:
# :gce:
# network_name: projects/vmpooler-example/global/networks/default
# project: vmpooler-example
# title: gce
# zone: us-west1-b
:dummy: :dummy:
filename: '/tmp/dummy-backing.yaml' filename: '/tmp/dummy-backing.yaml'
@ -23,13 +36,19 @@
allowed_tags: allowed_tags:
- 'created_by' - 'created_by'
- 'project' - 'project'
domain: 'example.com'
# domain: 'localhost' # Flip these out for local requests
:pools: :pools:
- name: 'debian-10-x86_64' # - name: 'fedora-36-x86_64'
template: 'Templates/debian-7-x86_64' # template: 'projects/fedora-cloud/global/images/fedora-cloud-base-gcp-36-20220506-n-0-x86-64'
folder: 'Pooled VMs/debian-7-x86_64' # size: 0
# provider: 'gce'
# dns_plugin: 'google-clouddns'
# machine_type: 'zones/us-west1-b/machineTypes/n1-standard-2'
# disk_type: 'pd-ssd'
# subnetwork_name: 'projects/vmpooler-example/regions/us-west1/subnetworks/default'
- name: 'debian-11-x86_64'
template: 'Templates/debian-11-x86_64'
folder: 'Pooled VMs/debian-11-x86_64'
datastore: 'vmstorage' datastore: 'vmstorage'
size: 5 size: 5
timeout: 15 timeout: 15

View file

@ -41,16 +41,21 @@ services:
- type: bind - type: bind
source: ./data/vmpooler.yaml source: ./data/vmpooler.yaml
target: /etc/vmpooler/vmpooler.yaml target: /etc/vmpooler/vmpooler.yaml
# - type: bind
# source: ./data/vmpooler-example-key.json
# target: /etc/vmpooler/vmpooler-example-key.json
ports: ports:
- "8082:4567" - "8082:4567"
environment: environment:
- VMPOOLER_DEBUG=true # for use of dummy auth - VMPOOLER_DEBUG=true # for use of dummy auth
- DEBUG_FLAG=true
- VMPOOLER_CONFIG_FILE=/etc/vmpooler/vmpooler.yaml - VMPOOLER_CONFIG_FILE=/etc/vmpooler/vmpooler.yaml
- REDIS_SERVER=redis-server - REDIS_SERVER=redis-server
- REDIS_PASSWORD=vmpooler - REDIS_PASSWORD=vmpooler
- LOGFILE=/dev/null - LOGFILE=/dev/null
- VMPOOLER_TRACING_ENABLED=true - VMPOOLER_TRACING_ENABLED=true
- VMPOOLER_TRACING_JAEGER_HOST=http://jaeger-aio:14268/api/traces - VMPOOLER_TRACING_JAEGER_HOST=http://jaeger-aio:14268/api/traces
# - GOOGLE_APPLICATION_CREDENTIALS=/etc/vmpooler/vmpooler-example-key.json
command: api command: api
links: links:
- redis-server - redis-server
@ -63,16 +68,21 @@ services:
- type: bind - type: bind
source: ./data/vmpooler.yaml source: ./data/vmpooler.yaml
target: /etc/vmpooler/vmpooler.yaml target: /etc/vmpooler/vmpooler.yaml
# - type: bind
# source: ./data/vmpooler-example-key.json
# target: /etc/vmpooler/vmpooler-example-key.json
ports: ports:
- "8083:4567" - "8083:4567"
environment: environment:
- VMPOOLER_DEBUG=true # for use of dummy auth - VMPOOLER_DEBUG=true # for use of dummy auth
- DEBUG_FLAG=true
- VMPOOLER_CONFIG_FILE=/etc/vmpooler/vmpooler.yaml - VMPOOLER_CONFIG_FILE=/etc/vmpooler/vmpooler.yaml
- REDIS_SERVER=redis-server - REDIS_SERVER=redis-server
- REDIS_PASSWORD=vmpooler - REDIS_PASSWORD=vmpooler
- LOGFILE=/dev/null - LOGFILE=/dev/null
- VMPOOLER_TRACING_ENABLED=true - VMPOOLER_TRACING_ENABLED=true
- VMPOOLER_TRACING_JAEGER_HOST=http://jaeger-aio:14268/api/traces - VMPOOLER_TRACING_JAEGER_HOST=http://jaeger-aio:14268/api/traces
# - GOOGLE_APPLICATION_CREDENTIALS=/etc/vmpooler/vmpooler-example-key.json
command: manager command: manager
links: links:
- redis-server - redis-server