Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Enrichment
wks
Commits
7fff7f79
Commit
7fff7f79
authored
Aug 19, 2020
by
harshit aggarwal
Browse files
Adding deployment script for azure to upload wks mappings to azure blob store
parent
0c5c7652
Pipeline
#6128
failed with stage
in 1 minute and 36 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
deployments/mappings/wks-mappings.json
0 → 100644
View file @
7fff7f79
{
"wksSchemaKind"
:
"opendes:wks:wellbore:1.0.0"
,
"attributeMappings"
:
[
{
"rawAttributeName"
:
"acl"
,
"wksAttributeName"
:
"acl"
},
{
"rawAttributeName"
:
"ancestry"
,
"wksAttributeName"
:
"ancestry"
},
{
"rawAttributeName"
:
"id"
,
"wksAttributeName"
:
"id"
},
{
"rawAttributeName"
:
"kind"
,
"wksAttributeName"
:
"kind"
},
{
"rawAttributeName"
:
"legal"
,
"wksAttributeName"
:
"legal"
},
{
"rawAttributeName"
:
"meta"
,
"wksAttributeName"
:
"meta"
},
{
"rawAttributeName"
:
"version"
,
"wksAttributeName"
:
"version"
},
{
"rawAttributeName"
:
"data.Spud date"
,
"wksAttributeName"
:
"data.spudDate"
},
{
"rawAttributeName"
:
"data.UWI"
,
"wksAttributeName"
:
"data.uwi"
},
{
"rawAttributeName"
:
"data.dlLatLongWGS84.latitude"
,
"wksAttributeName"
:
"data.dlWGS84.latitude"
},
{
"rawAttributeName"
:
"data.dlLatLongWGS84.longitude"
,
"wksAttributeName"
:
"data.dlWGS84.longitude"
}
]
}
deployments/scripts/azure/deploy_mappings.py
0 → 100644
View file @
7fff7f79
import
os
from
os
import
listdir
from
os.path
import
isfile
,
join
from
azure.storage.blob
import
BlobServiceClient
,
BlobClient
,
ContainerClient
connect_str
=
os
.
environ
.
get
(
'AZURE_STORAGE_CONNECTION_STRING'
)
container_name
=
os
.
environ
.
get
(
'STORAGE_CONTAINER'
)
blob_service_client
=
BlobServiceClient
.
from_connection_string
(
connect_str
)
local_folder
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"mappings"
)
def
upload_files
():
files
=
[
f
for
f
in
listdir
(
local_folder
)
if
isfile
(
join
(
local_folder
,
f
))]
for
file
in
files
:
local_file
=
join
(
local_folder
,
file
)
blob_client
=
blob_service_client
.
get_blob_client
(
container
=
container_name
,
blob
=
file
)
with
open
(
local_file
,
"rb"
)
as
data
:
blob_client
.
upload_blob
(
data
,
blob_type
=
"BlockBlob"
)
if
__name__
==
"__main__"
:
upload_files
()
\ No newline at end of file
deployments/scripts/azure/requirements.txt
0 → 100644
View file @
7fff7f79
os
azure.storage.blob
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment