Skip to content

Commit

Permalink
Merge resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Sep 7, 2024
1 parent a59e4c1 commit dda77e1
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 97 deletions.
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scheduler Genesis Kit
=================

This assumes a genesis deployed CF environment with the same environment name
This assumes a genesis deployed CF environment with the same environment name
has already been deployed.

Quick Start
Expand All @@ -27,7 +27,7 @@ Features
## `external-postgres` and `external-postgres-vault`

By default an internal (colocoated job) postgres is deployed for use. Optionally
you may configure to use an external PostgreSQL database by adding the
you may configure to use an external PostgreSQL database by adding the
`external-postgres-vault` feature together with the following in vault (no defaults).

```
Expand All @@ -40,10 +40,10 @@ secret/$env/vault/db:sslmode
secret/$env/vault/db:database
```

Note that when you do a `new` environment you will be prompted for these and
Note that when you do a `new` environment you will be prompted for these and
they will get stored in vault directly so you do not need to set them separately.

If you are using another system to generate them and stick into vault
If you are using another system to generate them and stick into vault
(ex: terraform) then it will be directly consumed.

You can do this using `safe` in a single command like so:
Expand All @@ -58,7 +58,7 @@ safe set secret/dev/ocf-scheduler/db \
database="scheduler"
```

for the `external-postgres` feature (no `-vault`) you can override defaults
for the `external-postgres` feature (no `-vault`) you can override defaults
using the environment file's params object:

```yaml
Expand All @@ -75,9 +75,26 @@ params:
## `cf-route-registrar`

By enabling the `cf-route-registrar` feature the kit will extrac the CF deployment
information required to register the scheduler API with CF at
information required to register the scheduler API with CF at
`scheduler.<cf_system_domain>`


## Number of Workers

The number of works defaults to 10 and can be set using the `worker_count` param, for example:
```yaml
params:
worker_count: 40
```

## Log Level

The log level defaults to `info` and can be set using the `log_level` param, for example:
```yaml
params:
log_level: debug
```

Params
------

Expand All @@ -88,10 +105,9 @@ Params per-feature are defined above.
Cloud Config
------------

The scheduler service is golang based and as such does not require a huge amount
The scheduler service is golang based and as such does not require a huge amount
of resources. That said be sure to allocate enough dedicated CPU vs time-shared.
Two cores should be sufficient.
Two cores should be sufficient.

If using the internal postgres feature (default) then more resources should be
If using the internal postgres feature (default) then more resources should be
allocated for the running of the PostgreSQL server.

8 changes: 4 additions & 4 deletions manifests/releases/scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
releases:
- name: ocf-scheduler
version: 0.1.3
url: https://github.com/cloudfoundry-community/ocf-scheduler-boshrelease/releases/download/v0.1.3/ocf-scheduler-0.1.3.tgz
sha1: a85249c2185b0b8383db5a7c86785c4f5b7fa6a8
- name: ocf-scheduler
version: 0.1.3
url: https://github.com/cloudfoundry-community/ocf-scheduler-boshrelease/releases/download/v0.1.3/ocf-scheduler-0.1.3.tgz
sha1: a85249c2185b0b8383db5a7c86785c4f5b7fa6a8
172 changes: 89 additions & 83 deletions manifests/scheduler.yml
Original file line number Diff line number Diff line change
@@ -1,132 +1,138 @@
---
meta:
cf:
exodus_path: (( concat $GENESIS_EXODUS_MOUNT genesis.env "/cf" ))
exodus_path: (( concat $GENESIS_EXODUS_MOUNT genesis.env "/cf" ))
deployment_name: (( concat genesis.env "-cf" ))
core_network: (( vault meta.cf.exodus_path ":core_network" ))
core_network: (( vault meta.cf.exodus_path ":core_network" ))

admin:
username: (( vault meta.cf.exodus_path ":admin_username" ))
password: (( vault meta.cf.exodus_path ":admin_password" ))
username: (( vault meta.cf.exodus_path ":admin_username" ))
password: (( vault meta.cf.exodus_path ":admin_password" ))

system:
domain: (( vault meta.cf.exodus_path ":system_domain" ))
org: (( vault meta.cf.exodus_path ":system_org" ))
space: (( vault meta.cf.exodus_path ":system_space" ))
api: (( concat "https://api." meta.cf.system.domain ))
domain: (( vault meta.cf.exodus_path ":system_domain" ))
org: (( vault meta.cf.exodus_path ":system_org" ))
space: (( vault meta.cf.exodus_path ":system_space" ))
api: (( concat "https://api." meta.cf.system.domain ))

nats:
client_cert: (( vault meta.cf.exodus_path ":nats_client_cert" ))
client_key: (( vault meta.cf.exodus_path ":nats_client_key" ))
client_cert: (( vault meta.cf.exodus_path ":nats_client_cert" ))
client_key: (( vault meta.cf.exodus_path ":nats_client_key" ))

uaa:
client_id: (( vault meta.cf.exodus_path ":app_scheduler_client" ))
client_id: (( vault meta.cf.exodus_path ":app_scheduler_client" ))
client_secret: (( vault meta.cf.exodus_path ":app_scheduler_secret" ))
endpoint: (( concat "https://uaa." meta.cf.system.domain ))
endpoint: (( concat "https://uaa." meta.cf.system.domain ))

scheduler:
domain: (( concat "scheduler." meta.cf.system.domain ))
domain: (( concat "scheduler." meta.cf.system.domain ))

networks:
- name: (( grab params.network || "default" ))
- name: (( grab params.network || "default" ))

azs:
- (( grab params.availability_zones || "z1"))
- (( grab params.availability_zones || "z1"))

vm_type: (( grab params.vm_type || "default" ))

smoke-tests:
vm_type: (( grab params.vm_type || "errand" ))

worker_count: (( grab params.worker_count || 10 ))

log_level: (( grab params.log_level || info ))

db:
scheme: "postgres"
scheme: "postgres"
username: "scheduler"
password: "scheduler"
hostname: "127.0.0.1"
port: "5432"
sslmode: "disable"
port: "5432"
sslmode: "disable"
database: "scheduler"

params: # NOTE: Contract with kit & genesis is that params are flat for kits.
pg_scheme: (( grab meta.db.scheme ))
pg_scheme: (( grab meta.db.scheme ))
pg_username: (( grab meta.db.username ))
pg_password: (( grab meta.db.password ))
pg_hostname: (( grab meta.db.hostname ))
pg_port: (( grab meta.db.port ))
pg_sslmode: (( grab meta.db.sslmode ))
pg_port: (( grab meta.db.port ))
pg_sslmode: (( grab meta.db.sslmode ))
pg_database: (( grab meta.db.database ))
pg_uri: (( concat "postgres://" params.pg_username ":" params.pg_password "@" params.pg_hostname ":" params.pg_port "/" params.pg_database "?sslmode=" params.pg_sslmode ))

instance_groups:
- name: scheduler
instances: 1
azs: (( grab meta.scheduler.azs ))
stemcell: (( grab meta.scheduler.stemcell.name || "default" ))
networks: (( grab meta.scheduler.networks ))
vm_type: (( grab meta.scheduler.vm_type ))

jobs:
- name: scheduler
release: ocf-scheduler
consumes:
postgres:
from: scheduler-postgres

properties:
scheduler:
uaa:
client_id: (( grab meta.cf.uaa.client_id ))
client_secret: (( grab meta.cf.uaa.client_secret ))
endpoint: (( grab meta.cf.uaa.endpoint ))
cf:
api: (( grab meta.cf.system.api ))
postgres:
uri: (( grab params.pg_uri ))

- name: postgres
properties:
databases:
roles:
- name: (( grab params.pg_username ))
password: (( grab params.pg_password ))
databases:
- name: (( grab params.pg_database ))
port: (( grab params.pg_port ))
provides:
postgres:
as: scheduler-postgres
release: postgres

- name: smoke-tests
instances: 1
azs: (( grab meta.scheduler.azs ))
stemcell: default
networks: (( grab meta.scheduler.networks ))
vm_type: (( grab meta.scheduler.smoke-tests.vm_type ))
lifecycle: errand

jobs:
instances: 1
azs: (( grab meta.scheduler.azs ))
stemcell: (( grab meta.scheduler.stemcell.name || "default" ))
networks: (( grab meta.scheduler.networks ))
vm_type: (( grab meta.scheduler.vm_type ))

jobs:
- name: scheduler
release: ocf-scheduler
consumes:
postgres:
from: scheduler-postgres

properties:
scheduler:
worker_count: (( grab meta.scheduler.worker_count ))
log_level: (( grab meta.scheduler.log_level ))
uaa:
client_id: (( grab meta.cf.uaa.client_id ))
client_secret: (( grab meta.cf.uaa.client_secret ))
endpoint: (( grab meta.cf.uaa.endpoint ))
cf:
api: (( grab meta.cf.system.api ))
postgres:
uri: (( grab params.pg_uri ))

- name: postgres
properties:
databases:
roles:
- name: (( grab params.pg_username ))
password: (( grab params.pg_password ))
databases:
- name: (( grab params.pg_database ))
port: (( grab params.pg_port ))
provides:
postgres:
as: scheduler-postgres
release: postgres

- name: smoke-tests
release: ocf-scheduler
properties:
cf:
username: (( grab meta.cf.admin.username ))
password: (( grab meta.cf.admin.password ))
api: (( grab meta.cf.system.api ))
organization: (( grab meta.cf.system.org ))
space: (( grab meta.cf.system.space ))
instances: 1
azs: (( grab meta.scheduler.azs ))
stemcell: default
networks: (( grab meta.scheduler.networks ))
vm_type: (( grab meta.scheduler.smoke-tests.vm_type ))
lifecycle: errand

jobs:
- name: smoke-tests
release: ocf-scheduler
properties:
cf:
username: (( grab meta.cf.admin.username ))
password: (( grab meta.cf.admin.password ))
api: (( grab meta.cf.system.api ))
organization: (( grab meta.cf.system.org ))
space: (( grab meta.cf.system.space ))

name: scheduler

update:
canaries: 1
max_errors: 1
max_in_flight: 1
serial: false
canaries: 1
max_errors: 1
max_in_flight: 1
serial: false
canary_watch_time: 5000-600000
update_watch_time: 5000-600000

stemcells:
- alias: default
os: (( grab params.stemcell_os || "ubuntu-jammy" ))
version: (( grab params.stemcell_version || "latest" ))
- alias: default
os: (( grab params.stemcell_os || "ubuntu-jammy" ))
version: (( grab params.stemcell_version || "latest" ))

0 comments on commit dda77e1

Please sign in to comment.