Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CloWM UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computational Metagenomics
CloWM
CloWM UI
Commits
8873dfe1
Verified
Commit
8873dfe1
authored
11 months ago
by
Daniel Göbel
Browse files
Options
Downloads
Patches
Plain Diff
Fix errors in s3 python/minio code snippet
#105
parent
2bc8ca9e
No related branches found
No related tags found
1 merge request
!106
Resolve "Fix erros in resource upload s3 code snippets"
Pipeline
#49673
passed
11 months ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/resources/modals/UploadResourceInfoModal.vue
+3
-3
3 additions, 3 deletions
src/components/resources/modals/UploadResourceInfoModal.vue
with
3 additions
and
3 deletions
src/components/resources/modals/UploadResourceInfoModal.vue
+
3
−
3
View file @
8873dfe1
...
...
@@ -72,7 +72,7 @@ s5cmd cp --show-progress /PATH/TO/RESOURCE \\
}
else
if
(
activeTool
.
value
===
Tool
.
MINIO
)
{
return
`mc alias set clowm-s3
${
environment
.
S3_URL
}
"
${
s3Key
.
value
.
access_key
}
" "
${
s3Key
.
value
.
secret_key
}
"
mc cp /PATH/TO/RESOURCE
\\
clowm-s3/
clowm-
resource
s/CLDB-eaa7aae4/eaaa1c99b14911ee9f5d0242ac120004/resource.tar.gz
`
;
clowm-s3/
${
resource
MinioS3Path
.
value
}
`
;
}
else
if
(
activeTool
.
value
===
Tool
.
PYTHON
)
{
return
`import boto3
...
...
@@ -86,7 +86,7 @@ s3 = boto3.resource(
with open("/PATH/TO/RESOURCE", "rb") as f:
s3.Object(
bucket="
${
resourceBucket
.
value
}
",
bucket
_name
="
${
resourceBucket
.
value
}
",
key="
${
resourceKey
.
value
}
"
).upload_fileobj(f)`
;
}
...
...
@@ -284,7 +284,7 @@ s3 = boto3.resource(
<span
class=
"hljs-keyword"
>
with
</span>
<span
class=
"hljs-built_in"
>
open
</span>
(
<span
class=
"hljs-string"
>
"/PATH/TO/RESOURCE"
</span>
,
<span
class=
"hljs-string"
>
"rb"
</span>
)
<span
class=
"hljs-keyword"
>
as
</span>
f:
s3.Object(
bucket=
<span
class=
"hljs-string"
>
"
{{
resourceBucket
}}
"
</span>
,
bucket
_name
=
<span
class=
"hljs-string"
>
"
{{
resourceBucket
}}
"
</span>
,
key=
<span
class=
"hljs-string"
>
"
{{
resourceKey
}}
"
</span>
).upload_fileobj(f)
</code></pre>
</
template
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment