Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Theia stack
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esa-common
che7
stacks
Theia stack
Commits
3f008b2f
Commit
3f008b2f
authored
5 years ago
by
edupin
Browse files
Options
Downloads
Patches
Plain Diff
working private data ingestion
parent
623faef8
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dockerfile
+4
-3
4 additions, 3 deletions
Dockerfile
Project_template/conf/sharedata.properties
+14
-10
14 additions, 10 deletions
Project_template/conf/sharedata.properties
ingestData.py
+17
-9
17 additions, 9 deletions
ingestData.py
shareData.sh
+0
-8
0 additions, 8 deletions
shareData.sh
with
35 additions
and
30 deletions
Dockerfile
+
4
−
3
View file @
3f008b2f
...
...
@@ -78,9 +78,10 @@ COPY quicklook_raster.py /usr/bmap/quicklook_raster.py
COPY
ingestData.py /usr/bmap/ingestData.py
COPY
ingestData.sh /usr/bmap/ingestData.sh
#RUN sudo chmod +x /usr/bmap/initTemplate.sh
#RUN sudo chmod +x /usr/bmap/shareAlgorithm.sh
#RUN sudo chmod +x /usr/bmap/ingestData.sh
USER
root
RUN
chmod
+x /usr/bmap/initTemplate.sh
RUN
chmod
+x /usr/bmap/shareAlgorithm.sh
RUN
chmod
+x /usr/bmap/ingestData.sh
ENV
PATH="/usr/bmap/:${PATH}"
ENV
PYTHONPATH="/usr/bmap/:${PYTHONPATH}"
#We add env variable to request the back end
...
...
This diff is collapsed.
Click to expand it.
Project_template/conf/sharedata.properties
+
14
−
10
View file @
3f008b2f
# Names of sub-regions (e.g. paracou, ...).
sub_region_name
=
La Lope
#MANDATORY FIELDS
#
Data polarization (e.g. HH, HV, VV, VH).
polarization
=
HH
#
User id (Find this number in the ESA MAAP portal, in the left panel > My account > Account Setings). mandatory
user_id
=
#
User id (Find this number in the ESA MAAP portal, in the left panel > My account > Account Setings).
user_id
=
20164
#
The path of the data (e.g. /projects/myProject/output/output_data_example.tiff). mandatory
data_path
=
# The
p
at
h
of the data (e.g.
/projects/myproject/output/mydata.tiff).
data_
path
=
/projects/SharePrivateData/output/output_data_example.tiff
# The
form
at of the data (e.g.
AZ, RG, DEM,ROI, SLC_HH, SLC_VV, SLC_VH, SLC_HV, INC, KZ). mandatory
data_
format
=
# The format of the data (e.g. AZ, RG, DEM,ROI, SLC_HH, SLC_VV, SLC_VH, SLC_HV, INC, KZ).
data_format
=
KZ
\ No newline at end of file
#OPTIONAL FIELDS
# Name of sub-region (e.g. paracou, ...). optional
sub_region_name
=
# Raster Data polarization (e.g. HH, HV, VV, VH). optional
polarization
=
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ingestData.py
+
17
−
9
View file @
3f008b2f
...
...
@@ -66,11 +66,13 @@ def ingestPrivateData(propertiesPath):
if
len
(
polarization
)
>
0
:
criteria_list
[
'
polarization
'
]
=
polarization
print
(
'
2.4- The polarization is
'
+
polarization
)
'''
else
:
criteria_list
[
'
polarization
'
]
=
None
'''
allVariableAreFilled = False;
print(
'
2.4- The polarization is mandatory
'
)
'''
except
:
pass
...
...
@@ -80,11 +82,14 @@ def ingestPrivateData(propertiesPath):
if
len
(
sub_region_name
)
>
0
:
criteria_list
[
'
subregionName
'
]
=
sub_region_name
print
(
'
2.5- The sub region is
'
+
sub_region_name
)
'''
else
:
'''
allVariableAreFilled = False;
print(
'
2.5- The sub region is mandatory
'
)
'''
'''
criteria_list
[
'
subregionName
'
]
=
None
except
:
pass
'''
...
...
@@ -132,7 +137,7 @@ def ingestPrivateData(propertiesPath):
######We call the back end service to start the ingestion
ingestTheData
(
criteria_list
,
folder_destination
+
"
/
"
+
os
.
path
.
basename
(
criteria_list
[
'
dataPath
'
]))
else
:
print
(
"
Please, fill
all
the
mandator
ie
s
v
ar
iables !!!!!!!!
"
)
print
(
"
Not
all mandator
y field
s ar
e filled.
"
)
#########Function to call the back end and check the id of the user
...
...
@@ -165,11 +170,14 @@ def sendARequest(url) :
print
(
'
ERROR:
'
+
str
(
e
))
logging
.
error
(
str
(
e
))
#########################################################################
def
ingestTheData
(
criteria_list
):
def
ingestTheData
(
criteria_list
,
destination
):
print
(
'
5- Your metadata are :
'
+
str
(
criteria_list
))
url
=
url_root
+
"
catalogue/granule/private/add?dataPath=
"
+
criteria_list
[
'
dataPath
'
]
+
"
&subregionName=
"
+
criteria_list
[
'
subregionName
'
]
+
"
&polarization=
"
+
criteria_list
[
'
polarization
'
]
+
"
&dataFormat=
"
+
criteria_list
[
'
dataFormat
'
]
+
"
&collectionName=
"
+
criteria_list
[
'
collectionName
'
]
+
"
&userId=
"
+
str
(
criteria_list
[
'
userId
'
])
#print(url)
print
(
'
destination
'
)
url
=
url_root
+
"
catalogue/granule/private/add?dataPath=
"
+
destination
+
"
&dataFormat=
"
+
criteria_list
[
'
dataFormat
'
]
+
"
&userId=
"
+
str
(
criteria_list
[
'
userId
'
])
print
(
url
)
#"&subregionName=" + criteria_list['subregionName'] +
#+ "&polarization=" +criteria_list['polarization']
response
=
requests
.
get
(
url
)
json_str
=
response
.
text
code
=
response
.
status_code
...
...
@@ -191,9 +199,9 @@ def isROIfileExistAll(datapath) :
for
i
in
range
(
len
(
listeOfRoi
)):
filePath
=
listeOfRoi
[
i
]
if
Path
(
filePath
).
is_file
():
print
(
"
ROI file f
ind
"
+
filePath
)
print
(
"
ROI file f
ound at
"
+
filePath
)
else
:
print
(
"
The
ROI file is missing
"
+
filePath
)
print
(
"
A mandatory
ROI file is missing
"
+
filePath
)
listeEmpty
=
[]
return
listeEmpty
...
...
This diff is collapsed.
Click to expand it.
shareData.sh
deleted
100644 → 0
+
0
−
8
View file @
623faef8
#!/bin/bash
# Ask the user for the path of the project
echo
"Hello, please enter the path of the sharedata properties"
echo
-n
"The path of the sharedata.properties of your project. It should be in /projects/THE_NAME_YOU_MUST_CHANGE/conf/sharedata.properties :"
read
propertiesPath
echo
"===> The path is : "
$propertiesPath
python /usr/bmap/ingestData.py
$propertiesPath
This diff is collapsed.
Click to expand it.
Preview
0%
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