Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
fix: make launcher img configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
minzcmu committed Oct 3, 2018
1 parent 6d6a5dc commit 0be448d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The class provides a couple options that are configurable in the instantiation o
| config.kubernetes.host | String | 'kubernetes.defaults' | The hostname for the Kubernetes cluster (kubernetes) |
| config.kubernetes.nodeSelectors| Object | | Object representing node label-value pairs https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#step-one-attach-label-to-the-node|
| config.ecosystem | Object | | Screwdriver Ecosystem (ui, api, store, pushgateway, etc.) |
| config.launchImage | String | 'screwdrivercd/launcher' | Launcher image to use |
| config.launchVersion | String | 'stable' | Launcher container version to use (stable) |
| config.prefix | String | '' |Prefix to container names ("") |
| config.jobsNamespace | String | 'default' | Kubernetes namespace where builds are running on |
Expand Down
2 changes: 1 addition & 1 deletion config/pod.yaml.tim
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
hyperctl rm builder-{{build_id_with_prefix}}"]
initContainers:
- name: launcher
image: screwdrivercd/launcher:{{launcher_version}}
image: {{launcher_image}}
command: ['/bin/sh', '-c', 'cp -a /opt/sd/* /opt/launcher && mkdir -p /opt/launcher/hab && cp -a /hab/* /opt/launcher/hab']
volumeMounts:
- mountPath: /opt/launcher
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class K8sVMExecutor extends Executor {
this.token = fs.existsSync(filepath) ? fs.readFileSync(filepath) : '';
}
this.host = this.kubernetes.host || 'kubernetes.default';
this.launchImage = options.launchImage || 'screwdrivercd/launcher';
this.launchVersion = options.launchVersion || 'stable';
this.prefix = options.prefix || '';
this.jobsNamespace = this.kubernetes.jobsNamespace || 'default';
Expand Down Expand Up @@ -252,7 +253,7 @@ class K8sVMExecutor extends Executor {
store_uri: this.ecosystem.store,
pushgateway_url: hoek.reach(this.ecosystem, 'pushgatewayUrl', { default: '' }),
token: config.token,
launcher_version: this.launchVersion,
launcher_image: `${this.launchImage}:${this.launchVersion}`,
base_image: this.baseImage
});

Expand Down
5 changes: 3 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ metadata:
memory: {{memory}}
name: {{build_id_with_prefix}}
container: {{container}}
launchVersion: {{launcher_version}}
launchImage: {{launcher_image}}
command:
- "/opt/sd/launch {{api_uri}} {{store_uri}} {{token}} {{build_timeout}} {{build_id}}"
spec:
Expand Down Expand Up @@ -48,6 +48,7 @@ describe('index', () => {
const testApiUri = 'http://api:8080';
const testStoreUri = 'http://store:8080';
const testContainer = 'node:4';
const testLaunchImage = 'screwdrivercd/launcher';
const testLaunchVersion = 'stable';
const podsUrl = 'https://kubernetes.default/api/v1/namespaces/default/pods';
const testSpec = {
Expand Down Expand Up @@ -407,7 +408,7 @@ describe('index', () => {
memory: 2048,
name: 'beta_15',
container: testContainer,
launchVersion: testLaunchVersion
launchImage: `${testLaunchImage}:${testLaunchVersion}`
},
spec: testPodSpec,
command: [
Expand Down

0 comments on commit 0be448d

Please sign in to comment.