EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 113b8691 authored by Mussab Abdalla's avatar Mussab Abdalla
Browse files

check swift auth

parent e5835f5a
No related branches found
No related tags found
1 merge request!29Preprocessor test
...@@ -40,7 +40,6 @@ docker stack deploy -c ../docker-compose.emg.yml -c ../docker-compose.emg.dev.ym ...@@ -40,7 +40,6 @@ docker stack deploy -c ../docker-compose.emg.yml -c ../docker-compose.emg.dev.ym
# installing the requirments # installing the requirments
apk update && apk add bash postgresql-dev gcc g++ python3 python3-dev musl-dev py-pip libffi-dev openssl-dev make gdal==3.1.4-r0 gdal-dev==3.1.4-r0 apk update && apk add bash postgresql-dev gcc g++ python3 python3-dev musl-dev py-pip libffi-dev openssl-dev make gdal==3.1.4-r0 gdal-dev==3.1.4-r0
gdalinfo --version
pip3 install -r requirements.txt pip3 install -r requirements.txt
./docker-stack-wait.sh -n renderer -n registrar -n preprocessor -n ingestor -n sftp emg-pvs ./docker-stack-wait.sh -n renderer -n registrar -n preprocessor -n ingestor -n sftp emg-pvs
......
import os import os
import sys import sys
import re
from osgeo import gdal from osgeo import gdal
def set_gdal_swift_auth(): def set_gdal_swift_auth():
with open('preprocessor_test.txt','r') as auth_values:
values_list = []
for aline in auth_values:
x = re.search("(?:=)(.*)", aline)
values_list.append(x.group(1))
storage_url=os.environ['SWIFT_STORAGE_URL'] gdal.SetConfigOption("SWIFT_STORAGE_URL", values_list[0])
auth_token=os.environ['SWIFT_AUTH_TOKEN'] gdal.SetConfigOption("SWIFT_AUTH_TOKEN", values_list[1])
# setting gdal config
gdal.SetConfigOption("SWIFT_STORAGE_URL", storage_url)
gdal.SetConfigOption("SWIFT_AUTH_TOKEN", auth_token)
......
...@@ -19,13 +19,16 @@ IFS="=" ...@@ -19,13 +19,16 @@ IFS="="
while read key value ; do while read key value ; do
if [ "$key" = "export OS_STORAGE_URL" ]; then if [ "$key" = "export OS_STORAGE_URL" ]; then
export SWIFT_STORAGE_URL=$value export SWIFT_STORAGE_URL=$value
else else
export SWIFT_AUTH_TOKEN=$value export SWIFT_AUTH_TOKEN=$value
fi fi
done < preprocessor_test.txt done < preprocessor_test.txt
cat preprocessor_test.txt
printenv
while read product; do while read product; do
echo $product echo $product
# preprocessing the images and save the results in the result bucket # preprocessing the images and save the results in the result bucket
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment