Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fibonacci #258

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions component-library/examples/fibonacci.cwl
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: []
20 changes: 20 additions & 0 deletions component-library/examples/fibonacci.job.yaml
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
10 changes: 10 additions & 0 deletions component-library/examples/fibonacci.py
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))
21 changes: 21 additions & 0 deletions component-library/examples/fibonacci.yaml
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}
Loading