-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hello Romeo, here is the fibonacci claimed component you requested.
- Loading branch information
1 parent
cd65831
commit 13c4a79
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cwlVersion: v1.2 | ||
class: CommandLineTool | ||
|
||
baseCommand: "claimed" | ||
|
||
inputs: | ||
component: | ||
type: string | ||
default: docker.io/mdorzweiler/claimed-fibonacci:0.1 | ||
inputBinding: | ||
position: 1 | ||
prefix: --component | ||
log_level: | ||
type: string | ||
default: "INFO" | ||
inputBinding: | ||
position: 2 | ||
prefix: --log_level | ||
b: | ||
type: string | ||
default: None | ||
inputBinding: | ||
position: 3 | ||
prefix: --b | ||
|
||
|
||
outputs: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: fibonacci | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: fibonacci | ||
image: docker.io/mdorzweiler/claimed-fibonacci:0.1 | ||
workingDir: /opt/app-root/src/ | ||
command: ["/opt/app-root/bin/python","claimed_fibonacci.py"] | ||
env: | ||
- name: log_level | ||
value: value_of_log_level | ||
- name: b | ||
value: value_of_b | ||
restartPolicy: OnFailure | ||
imagePullSecrets: | ||
- name: image_pull_secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def fib(b): | ||
n = int(b) | ||
if n == 0: | ||
return 0 | ||
if n == 1: | ||
return 1 | ||
return fib(n-2) + fib(n-1) | ||
|
||
b = os.getenv('b') | ||
print(fib(b)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: fibonacci | ||
description: "claimed-fibonacci – CLAIMED V0.1" | ||
|
||
inputs: | ||
- {name: log_level, type: String, description: "update log level", default: "INFO"} | ||
- {name: b, type: String, description: ""} | ||
|
||
|
||
outputs: | ||
|
||
|
||
implementation: | ||
container: | ||
image: docker.io/mdorzweiler/claimed-fibonacci:0.1 | ||
command: | ||
- sh | ||
- -ec | ||
- | | ||
python ./claimed_fibonacci.py log_level="${0}" b="${1}" | ||
- {inputValue: log_level} | ||
- {inputValue: b} |