Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
miclip committed Jul 6, 2019
0 parents commit 000a777
Show file tree
Hide file tree
Showing 13 changed files with 216 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

*.tgz

*.pivotal
.DS_Store
21 changes: 21 additions & 0 deletions bake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ver="$(cat version)"
ver=$((ver+1))
VERSTR="0.0.1-build.${ver}"
export PRODUCT_NAME="concourse-worker-${VERSTR}.pivotal"
echo "Baking Version ${VERSTR}"
echo "${ver}" > version

kiln bake \
--version $VERSTR \
--metadata base.yml \
--forms-directory forms \
--properties-directory properties \
--releases-directory releases \
--instance-groups-directory instance_groups \
--jobs-directory jobs \
--stemcells-directory stemcell \
--icon icon.png \
--output-file "${PRODUCT_NAME}"

#om -k upload-product -p "${PRODUCT_NAME}"
#om -k stage-product -p control-plane -v "${VERSTR}"
37 changes: 37 additions & 0 deletions base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: concourse-workers
label: Concourse External Workers
description: Concourse External Workers

metadata_version: "2.2"
minimum_version_for_upgrade: 0.0
product_version: $( version )

icon_image: $( icon )

rank: 90
serial: false

stemcell_criteria: $( stemcell )

releases:
- $( release "concourse" )
- $( release "garden-runc" )

form_types:
- $( form "tsa" )
- $( form "worker" )

job_types:
- $( instance_group "worker" )

property_blueprints:
- $( property "tsa_host_key" )
- $( property "worker_key" )
- $( property "tsa_endpoint" )
- $( property "tsa_port" )
- $( property "worker_tag" )




20 changes: 20 additions & 0 deletions forms/tsa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: tsa
label: 'TSA'
description: 'Control Plane TSA'
property_inputs:
- reference: .properties.tsa_host_key
label: 'TSA Host Public Key'
description: 'Configure TSA Host Public Key'
- reference: .properties.worker_key
label: 'Worker Key'
description: '... worker key'
- reference: .properties.tsa_endpoint
label: 'TSA Endpoint'
description: 'IP address or endpoint'
placeholder: tsa.example.com
- reference: .properties.tsa_port
label: 'TSA Port'
description: 'TSA Port'
placeholder: 2222

13 changes: 13 additions & 0 deletions forms/worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: worker
label: Worker
description: |
Sets the worker configuration
markdown: |
### What is this?
property_inputs:
- reference: .properties.worker_tag
label: 'Worker Tag'
description: 'Concourse tag to assign to the workers'
placeholder: sandbox
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions instance_groups/worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: worker
label: Concourse Worker VM
resource_label: Concourse Worker VM
description: Runs your concourse jobs
templates:
- $( job "worker" )
- $( job "garden" )
- $( job "baggageclaim" )

resource_definitions:
- name: cpu
type: integer
label: CPU
configurable: true
default: 2
constraints:
min: 2

- name: ram
type: integer
label: RAM
configurable: true
default: 8192
constraints:
min: 8192

- name: ephemeral_disk
type: integer
label: Ephemeral Disk
configurable: true
default: 10240
constraints:
min: 10240

- name: persistent_disk
type: integer
label: Persistent Disk
configurable: false
default: 0

max_in_flight: 1
single_az_only: false

instance_definition:
name: instances
type: integer
label: Instances
configurable: true
default: 1
constraints:
min: 0
6 changes: 6 additions & 0 deletions jobs/baggageclaim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: baggageclaim
release: concourse
provides: |
baggageclaim:
as: worker-baggageclaim
8 changes: 8 additions & 0 deletions jobs/garden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: garden
release: garden-runc
manifest: |
garden:
forward_address: 127.0.0.1:7777
listen_network: tcp
listen_address: 127.0.0.1:7777
21 changes: 21 additions & 0 deletions jobs/worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: worker
release: concourse
consumes: |
baggagclaim:
from: worker-baggageclaim
manifest: |
drain_timeout: 10m
tags: [(( .properties.worker_tag.value ))]
tsa:
worker_key:
private_key: (( .properties.worker_key.value ))
host: (( .properties.tsa_endpoint.value ))
port: (( .properties.tsa_port.value ))
host_public_key: (( .properties.tsa_host_key.value ))
registration_mode: forward
garden:
address: 127.0.0.1:7777
forward_address: 127.0.0.1:7777
baggageclaim:
forward_address: 127.0.0.1:7788
22 changes: 22 additions & 0 deletions properties/tsa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
- name: tsa_host_key
type: string
configurable: true
optional: false

- name: worker_key
type: text
configurable: true
optional: false

- name: tsa_endpoint
type: domain
configurable: true
optional: false

- name: tsa_port
type: port
configurable: true
optional: false


6 changes: 6 additions & 0 deletions properties/worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: worker_tag
type: string
configurable: true
optional: false
default: sandbox_worker
1 change: 1 addition & 0 deletions version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21

0 comments on commit 000a777

Please sign in to comment.