Skip to content

Commit 5fc8fce

Browse files
author
chris vugrinec
committedDec 7, 2016
added youtube flic
1 parent 65f3c12 commit 5fc8fce

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed
 

‎azure-batch/gis-ahndockerjob/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Documentation Azure Batch - gis ahn docker job
22

3+
See it in action: https://youtu.be/1th0ZSnuVFY
4+
35
## What is it
46

57
A tool that gets geographical data from geodata.nationaalgeoregister.nl, unzips the tif files and put them on azure blob storage.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
2+
container=$(cat /opt/scripts/config/config.txt | grep container_name | sed 's/container_name=//')
23
export AZURE_STORAGE_CONNECTION_STRING=$(cat /opt/scripts/config/config.txt | grep azure_connection_string | sed 's/azure_connection_string=//')
34
filetoget="$1"
45
wget $filetoget -O /opt/scripts/temp.zip 2>/dev/null
56
xxx=$(unzip /opt/scripts/temp.zip)
67
unzippedfile=$(echo $xxx | awk '{print $4}')
78
echo "unzipped file: "$unzippedfile
8-
azure storage blob upload /$unzippedfile ahndata 2>/dev/null
9+
azure storage blob upload /$unzippedfile $container 2>/dev/null
910
rm -f /opt/scripts/temp.zip 2>/dev/null
1011
rm -f /$unzippedfile 2>/dev/null

‎azure-batch/gis-ahndockerjob/resources/config.txt.example

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
redis_url=gisdata.redis.cache.windows.net
33
redis_key=[YOUR REDIS KEY GOES HERE]
44
azure_connection_string=DefaultEndpointsProtocol=https;AccountName=gisstoragedata;AccountKey=[LONG COMPLICATED KEY}
5+
container_name=ahndata-demo

‎azure-batch/gis-ahndockerjob/startjob.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def do_dockerstuff(batch_client, block_blob_client, job_id, pool_id, docker_user
3838
'cd /opt/scripts/config',
3939
'wget '+common.helpers._read_stream_as_string('\"'+config_url+'\" -O /opt/scripts/config/config.txt','utf-8'),
4040
'docker login chris-microsoft.azurecr.io -u '+docker_user+' -p '+docker_password,
41-
'docker run -i -v `pwd`:/opt/scripts/config chris-microsoft.azurecr.io/gis-azureshipyarjob:2.1 /opt/scripts/getdata.sh',
41+
'docker run -i -v `pwd`:/opt/scripts/config chris-microsoft.azurecr.io/gis-azureshipyarjob:2.2 /opt/scripts/getdata.sh',
4242
]
4343
task_name=common.helpers.generate_unique_resource_name(_TASK_NAME)
4444
print('adding task: '+task_name)
@@ -141,7 +141,7 @@ def create_pool_and_wait_for_nodes( batch_client, block_blob_client, pool_id, vm
141141
task_id = do_dockerstuff(batch_client, block_blob_client, job_id, pool_id, docker_user, docker_password)
142142

143143
# wait for tasks to complete
144-
common.helpers.wait_for_tasks_to_complete( batch_client, job_id, datetime.timedelta(minutes=5))
144+
common.helpers.wait_for_tasks_to_complete( batch_client, job_id, datetime.timedelta(minutes=15))
145145
finally:
146146
if should_delete_container:
147147
print('Deleting container: {}'.format(_CONTAINER_NAME))

0 commit comments

Comments
 (0)
Please sign in to comment.