Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Data Logistics Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eFlows4HPC WP2
Data Logistics Service
Commits
d6889f39
Commit
d6889f39
authored
3 years ago
by
Jedrzej Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
housekeeping + url return
parent
f0be852d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#99724
passed
3 years ago
Stage: test
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
dags/image_transfer_alt.py
+1
-1
1 addition, 1 deletion
dags/image_transfer_alt.py
dags/justreg.py
+2
-4
2 additions, 4 deletions
dags/justreg.py
dags/uploadflow.py
+3
-3
3 additions, 3 deletions
dags/uploadflow.py
with
6 additions
and
8 deletions
dags/image_transfer_alt.py
+
1
−
1
View file @
d6889f39
...
@@ -6,7 +6,7 @@ from airflow.decorators import dag, task
...
@@ -6,7 +6,7 @@ from airflow.decorators import dag, task
from
airflow.utils.dates
import
days_ago
from
airflow.utils.dates
import
days_ago
from
airflow.operators.python
import
PythonOperator
from
airflow.operators.python
import
PythonOperator
from
airflow.models
import
Variable
from
airflow.models
import
Variable
from
just
_
reg
import
get_parameter
from
justreg
import
get_parameter
from
decors
import
setup
,
get_connection
,
remove
from
decors
import
setup
,
get_connection
,
remove
default_args
=
{
default_args
=
{
...
...
This diff is collapsed.
Click to expand it.
dags/just
_
reg.py
→
dags/justreg.py
+
2
−
4
View file @
d6889f39
from
airflow.decorators
import
dag
,
task
from
airflow.decorators
import
dag
,
task
from
airflow.models.connection
import
Connection
from
airflow.operators.bash
import
BashOperator
from
airflow.operators.bash
import
BashOperator
from
airflow.providers.http.hooks.http
import
HttpHook
from
airflow.utils.dates
import
days_ago
from
airflow.utils.dates
import
days_ago
from
datacat_integration.hooks
import
DataCatalogHook
from
datacat_integration.hooks
import
DataCatalogHook
from
datacat_integration.connection
import
DataCatalogEntry
from
datacat_integration.connection
import
DataCatalogEntry
...
@@ -65,7 +63,7 @@ def datacat_registration_example():
...
@@ -65,7 +63,7 @@ def datacat_registration_example():
try
:
try
:
r
=
hook
.
create_entry
(
datacat_type
=
'
dataset
'
,
entry
=
entry
)
r
=
hook
.
create_entry
(
datacat_type
=
'
dataset
'
,
entry
=
entry
)
print
(
"
Hook registration returned:
"
,
r
)
print
(
"
Hook registration returned:
"
,
r
)
return
r
return
f
"
{
hook
.
base_url
}
/dataset/
{
r
}
"
except
ConnectionError
as
e
:
except
ConnectionError
as
e
:
print
(
'
Registration failed
'
,
e
)
print
(
'
Registration failed
'
,
e
)
return
-
1
return
-
1
...
@@ -85,7 +83,7 @@ def datacat_registration_example():
...
@@ -85,7 +83,7 @@ def datacat_registration_example():
step1
=
BashOperator
(
bash_command
=
'
curl -X GET -k https://bscgrid20.bsc.es/image_creation/images/download/wordcount_skylake.sif -o /work/ww
'
,
task_id
=
'
nothing
'
)
step1
=
BashOperator
(
task_id
=
'
jj
'
,
bash_command
=
'
ls
'
)
#
BashOperator(bash_command='curl -X GET -k https://bscgrid20.bsc.es/image_creation/images/download/wordcount_skylake.sif -o /work/ww', task_id='nothing')
step2
=
register
(
step2
=
register
(
object_url
=
'
https://b2share-testing.fz-juelich.de/records/7a12fda26b2a4d248f96d012d54769b7
'
)
object_url
=
'
https://b2share-testing.fz-juelich.de/records/7a12fda26b2a4d248f96d012d54769b7
'
)
...
...
This diff is collapsed.
Click to expand it.
dags/uploadflow.py
+
3
−
3
View file @
d6889f39
...
@@ -12,7 +12,7 @@ from airflow.utils.dates import days_ago
...
@@ -12,7 +12,7 @@ from airflow.utils.dates import days_ago
from
b2shareoperator
import
(
add_file
,
create_draft_record
,
get_community
,
from
b2shareoperator
import
(
add_file
,
create_draft_record
,
get_community
,
submit_draft
)
submit_draft
)
from
decors
import
get_connection
,
remove
,
setup
from
decors
import
get_connection
,
remove
,
setup
from
just
_
reg
import
get_parameter
from
justreg
import
get_parameter
from
datacat_integration.hooks
import
DataCatalogHook
from
datacat_integration.hooks
import
DataCatalogHook
from
datacat_integration.connection
import
DataCatalogEntry
from
datacat_integration.connection
import
DataCatalogEntry
...
@@ -120,7 +120,7 @@ def upload_example():
...
@@ -120,7 +120,7 @@ def upload_example():
return
0
return
0
hook
=
DataCatalogHook
()
hook
=
DataCatalogHook
()
print
(
"
Connected to datacat via hook
"
,
hook
.
list_type
(
'
dataset
'
)
)
print
(
"
Connected to datacat via hook
"
)
entry
=
DataCatalogEntry
(
name
=
f
"
DLS results
{
kwargs
[
'
run_id
'
]
}
"
,
entry
=
DataCatalogEntry
(
name
=
f
"
DLS results
{
kwargs
[
'
run_id
'
]
}
"
,
url
=
object_url
,
url
=
object_url
,
...
@@ -131,7 +131,7 @@ def upload_example():
...
@@ -131,7 +131,7 @@ def upload_example():
try
:
try
:
r
=
hook
.
create_entry
(
datacat_type
=
'
dataset
'
,
entry
=
entry
)
r
=
hook
.
create_entry
(
datacat_type
=
'
dataset
'
,
entry
=
entry
)
print
(
"
Hook registration returned:
"
,
r
)
print
(
"
Hook registration returned:
"
,
r
)
return
r
return
f
"
{
hook
.
base_url
}
/dataset/
{
r
}
"
except
ConnectionError
as
e
:
except
ConnectionError
as
e
:
print
(
'
Registration failed
'
,
e
)
print
(
'
Registration failed
'
,
e
)
return
-
1
return
-
1
...
...
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