Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
instance_segmentation_classic
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
Maciej Wielgosz
instance_segmentation_classic
Commits
0aa36917
Commit
0aa36917
authored
2 years ago
by
Maciej Wielgosz
Browse files
Options
Downloads
Patches
Plain Diff
oracle wrapper - reading input from env vars
parent
cca432fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run_oracle_wrapper.py
+19
-9
19 additions, 9 deletions
run_oracle_wrapper.py
with
19 additions
and
9 deletions
run_oracle_wrapper.py
+
19
−
9
View file @
0aa36917
...
...
@@ -8,6 +8,7 @@ import sys
import
json
import
shutil
import
yaml
from
urllib.parse
import
urlparse
from
pathlib
import
Path
from
oci.config
import
validate_config
from
oci.object_storage
import
ObjectStorageClient
...
...
@@ -24,15 +25,24 @@ def run_oracle_wrapper(path_to_config_file):
# create the client
client
=
ObjectStorageClient
(
config
)
# get the namespace
namespace
=
client
.
get_namespace
().
data
# get the bucket name
bucket_name
=
'
bucket_lidar_data
'
# folder name inside the bucket
input_folder_in_bucket
=
'
geoslam
'
# read system environment variables
input_location
=
os
.
environ
[
'
OBJ_INPUT_LOCATION
'
]
if
input_location
is
not
None
:
print
(
'
Taking the input from the location
'
+
input_location
)
parsed_url
=
urlparse
(
input_location
)
input_folder_in_bucket
=
parsed_url
.
path
[
1
:]
bucket_name
=
parsed_url
.
netloc
.
split
(
'
@
'
)[
0
]
namespace
=
parsed_url
.
netloc
.
split
(
'
@
'
)[
1
]
else
:
print
(
'
Taking the input from the default location
'
)
# get the namespace
namespace
=
client
.
get_namespace
().
data
# get the bucket name
bucket_name
=
'
bucket_lidar_data
'
# folder name inside the bucket
input_folder_in_bucket
=
'
geoslam
'
# read the config file from config folder
with
open
(
path_to_config_file
)
as
f
:
...
...
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