Skip to content

Commit

Permalink
#126 - Adding docker-compose.yml config file for both of locations. U…
Browse files Browse the repository at this point in the history
…pdating science_gateway.py to split control and data IPs.
  • Loading branch information
Sean Donovan committed Nov 16, 2019
1 parent 91adbb4 commit e97ff68
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 13 deletions.
32 changes: 32 additions & 0 deletions configuration/awave-deployment/mia/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 3.3
services:
localctlr:
image: lc_container
container_name: localctlr
ports:
- '6633:6633'
volumes:
-/home/sean/atlanticwave-proto:/development:rw
environment:
- MANIFEST=/development/configuration/awave-deployment/awave.manifest
- SITE=mia-ctlr-186-106
- PYTHONPATH=.:/development
- SDXIP=10.100.1.21
- AWAVEDIR=/development

ftpd:
image:metabrains/docker-anon-ftp
ports:
- "10.201.2.28:20-21:20-21"
volumes:
- "/tmp:/var/ftp:ro"
environment:
- FTPD_BANNER=Anonymous FTP Server

pseudo_dtn:
image: pseudo_dtn
ports:
- SERVERIP=10.100.1.27
- SERVERPORT=9999


53 changes: 53 additions & 0 deletions configuration/awave-deployment/sox/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
version: '3.3'
services:
sdxctlr:
image: sdx_container
container_name: sdxctlr
ports:
- '5000:5000'
- '5555:5555'
volumes:
- /home/sdonovan33/atlanticwave-proto:/development:rw
environment:
- MANIFEST=/development/configuration/awave-deployment/awave.manifest
- IPADDR=0.0.0.0
- PORT=5000
- LCPORT=5555
- PYTHONPATH=.:/development/
- AWAVEDIR=/development
restart: always

localctlr:
image: lc_container
container_name: localctlr
ports:
- '6653:6653'
volumes:
- /home/sdonovan33/atlanticwave-proto:/development:rw
environment:
- MANIFEST=/development/configuration/awave-deployment/awave.manifest
- SITE=gt-ctlr-149-223
- PYTHONPATH=.:/development/
- SDXIP=sox_sdx_controller
- AWAVEDIR=/development

ftpd:
image: metabrains/docker-anon-ftp
ports:
- "10.201.2.21:20-21:20-21"
volumes:
- "/tmp:/var/ftp:ro"
environment:
- FTPD_BANNER=Anonymous FTP Server

pseudo_dtn:
image: pseudo_dtn
ports:
- "10.100.1.21:9999:9999"
environment:
- SERVERIP=10.100.1.21
- SERVERPORT=9999

science_gateway:
image: science_gateway

19 changes: 19 additions & 0 deletions docker/pseudo_dtn/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
ftpd:
image: metabrainz/docker-anon-ftp
ports:
- "20-21:20-21"
- "65500-65515:65500-65515"
volumes:
- "/tmp:/var/ftp:ro"
environment:
- FTPD_BANNER=Anonymous FTP server

pseudo_dtn:
image: pseudo_dtn
ports:
- "9999:9999"
environment:
- FTPD_BANNER=Anonymous
- SERVERIP=10.100.100.100
- SERVERPORT=9999
27 changes: 14 additions & 13 deletions docker/sci_gw_demo/science_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@
port = 9999

# List of endpoints
endpoints = {'atl-dtn':{'ip':'127.0.0.1','port':9999,
'switch':'atl-switch', 'switchport':3, 'vlan':123},
'mia-dtn':{'ip':'127.0.0.1','port':9998,
'switch':'mia-switch', 'switchport':2, 'vlan':123}}
endpoints = {'atl-dtn':{'ctrlip':'10.100.1.21','port':9999,
'dataip':'10.201.2.21',
'switch':'atl-switch', 'switchport':4, 'vlan':201},
'mia-dtn':{'ctrlip':'10.100.1.27','port':9999,
'dataip':'10.201.2.28',
'switch':'mia-switch', 'switchport':10, 'vlan':124}}

global sdx_ip, sdx_port, sdx_user, sdx_pw, login_cookie, tunnel_policy
sdx_ip = '1.2.3.4'
sdx_ip = '10.100.1.21'
sdx_port = 5555
sdx_user = 'sdonovan'
sdx_pw = '1234'
Expand Down Expand Up @@ -128,8 +130,8 @@ def get_ep_dict_from_num(endpoints, num):
return endpoints[ep]
a += 1

def get_dir(srcip, srcport):
endpoint = 'http://%s:%s/dtn/transfer/%s' % (srcip, srcport, srcip)
def get_dir(ctrlip, dataip, srcport):
endpoint = 'http://%s:%s/dtn/transfer/%s' % (ctrlip, srcport, dataip)
output = subprocess.check_output(['curl', '-X', 'GET', endpoint])
return output.decode('utf-8')

Expand All @@ -148,18 +150,18 @@ def print_files(files):
a += 1


def transfer_file(srcip, srcport, dstip, dstport, filename):
def transfer_file(srcdataip, dstctrlip, dstport, filename):
timeout = 1000

# Execute file transfer
endpoint = 'http://%s:%s/dtn/transfer/%s/%s' % (
dstip, dstport, srcip, filename)
dstctrlip, dstport, srcdataip, filename)
output = subprocess.check_output(['curl', '-X', 'POST', endpoint])
output = output.decode('utf-8')
print("Transferring file: %s" % output)

# loop here, checking on status
endpoint = 'http://%s:%s/dtn/status' % (dstip, dstport)
endpoint = 'http://%s:%s/dtn/status' % (dstctrlip, dstport)

count = 0
while(('Started transfer' in output) or
Expand Down Expand Up @@ -198,7 +200,7 @@ def transfer_file(srcip, srcport, dstip, dstport, filename):
timedelta(0,1))

# Get and display files available on src
rawfiles = get_dir(srcdict['ip'], srcdict['port'])
rawfiles = get_dir(srcdict['ctrlip'], dstdict['dataip'], srcdict['port'])
fileslist = parse_files(rawfiles)
print_files(fileslist)
delete_tunnel()
Expand All @@ -214,8 +216,7 @@ def transfer_file(srcip, srcport, dstip, dstport, filename):
timedelta(1,0)) # 1 day, excessive, but we'll delete it, don't worry

# Make transfer call
transfer_file(srcdict['ip'], srcdict['port'],
dstdict['ip'], dstdict['port'], filename)
transfer_file(srcdict['dataip'], dstdict['ctrlip'], dstdict['port'], filename)

# Clean up
delete_tunnel()

0 comments on commit e97ff68

Please sign in to comment.