Skip to content

Commit

Permalink
Merge pull request #254 from romeokienzler/main
Browse files Browse the repository at this point in the history
update util-cos to support cos connection strings
  • Loading branch information
romeokienzler committed Mar 28, 2024
2 parents dcaaf32 + 8f3423c commit ed4b49e
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ celerybeat.pid
.pytype/
cython_debug/
venv/
.venv/
45 changes: 45 additions & 0 deletions component-library/util/util-cos.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cwlVersion: v1.2
class: CommandLineTool

baseCommand: "claimed"

inputs:
component:
type: string
default: docker.io/romeokienzler/claimed-util-cos:0.39
inputBinding:
position: 1
prefix: --component
log_level:
type: string
default: "INFO"
inputBinding:
position: 2
prefix: --log_level
cos_connection:
type: string
default: None
inputBinding:
position: 3
prefix: --cos_connection
local_path:
type: string
default: None
inputBinding:
position: 4
prefix: --local_path
recursive:
type: bool
default: False
inputBinding:
position: 5
prefix: --recursive
operation:
type: string
default: None
inputBinding:
position: 6
prefix: --operation


outputs: []
31 changes: 12 additions & 19 deletions component-library/util/util-cos.job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,20 @@ spec:
spec:
containers:
- name: util-cos
image: docker.io/romeokienzler/claimed-util-cos:0.35
command: ["/opt/app-root/bin/ipython","/opt/app-root/src/util-cos.ipynb"]
image: docker.io/romeokienzler/claimed-util-cos:0.39
workingDir: /opt/app-root/src/
command: ["/opt/app-root/bin/ipython","claimed_util-cos.ipynb"]
env:
- name: access_key_id
value: value_of_access_key_id
- name: secret_access_key
value: value_of_secret_access_key
- name: endpoint
value: value_of_endpoint
- name: bucket_name
value: value_of_bucket_name
- name: path
value: value_of_path
- name: source
value: value_of_source
- name: target
value: value_of_target
- name: log_level
value: value_of_log_level
- name: cos_connection
value: value_of_cos_connection
- name: local_path
value: value_of_local_path
- name: recursive
value: value_of_recursive
- name: operation
value: value_of_operation
- name: log_level
value: value_of_log_level
restartPolicy: OnFailure
restartPolicy: OnFailure
imagePullSecrets:
- name: image_pull_secret
36 changes: 14 additions & 22 deletions component-library/util/util-cos.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
name: util-cos
description: This component provides COS utility functions (e.g. creating a bucket, listing contents of a bucket)
CLAIMED v0.35
description: "# util-cos This component provides COS utility functions (e.g. creating a bucket, listing contents of a bucket) – CLAIMED V0.1"

inputs:
- {name: access_key_id, type: String, description: access key id}
- {name: secret_access_key, type: String, description: secret access key}
- {name: endpoint, type: String, description: cos/s3 endpoint}
- {name: bucket_name, type: String, description: cos bucket name}
- {name: path, type: String, description: path, default: ''}
- {name: source, type: String, description: source in case of uploads, default: ''}
- {name: target, type: String, description: target in case of downloads, default: ''}
- {name: recursive, type: Boolean, description: recursive, default: 'False'}
- {name: operation, type: String, description: operation (mkdir|ls|find|get|put|rm|sync_to_cos|sync_to_local|glob)}
- {name: log_level, type: String, description: log level, default: 'INFO'}
- {name: log_level, type: String, description: "update log level", default: "INFO"}
- {name: cos_connection, type: String, description: "cos_connection in format: [cos|s3]://access_key_id:secret_access_key@endpoint/bucket/path"}
- {name: local_path, type: String, description: "local_path for uploads, downloads, sync"}
- {name: recursive, type: Boolean, description: "recursive", default: "False'"}
- {name: operation, type: String, description: "operation (mkdir|ls|find|get|put|rm|sync_to_cos|sync_to_local|glob)"}


outputs:


implementation:
container:
image: docker.io/romeokienzler/claimed-util-cos:0.35
image: docker.io/romeokienzler/claimed-util-cos:0.39
command:
- sh
- -ec
- |
ipython ./util-cos.ipynb access_key_id="${0}" secret_access_key="${1}" endpoint="${2}" bucket_name="${3}" path="${4}" source="${5}" target="${6}" recursive="${7}" operation="${8}" log_level="${9}"
- {inputValue: access_key_id}
- {inputValue: secret_access_key}
- {inputValue: endpoint}
- {inputValue: bucket_name}
- {inputValue: path}
- {inputValue: source}
- {inputValue: target}
ipython ./claimed_util-cos.ipynb log_level="${0}" cos_connection="${1}" local_path="${2}" recursive="${3}" operation="${4}"
- {inputValue: log_level}
- {inputValue: cos_connection}
- {inputValue: local_path}
- {inputValue: recursive}
- {inputValue: operation}
- {inputValue: log_level}

0 comments on commit ed4b49e

Please sign in to comment.