Skip to content

Commit

Permalink
Version bump to 2.0.6. Added 'ide-fetcher.py' to facilitate pulling t…
Browse files Browse the repository at this point in the history
…he IDE tarball for a specific version without hard-coding the whole tarball name.
  • Loading branch information
Thomas Goodwin committed Jul 19, 2017
1 parent fa29db9 commit 2de451e
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Dockerfiles/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
FROM ubuntu:16.04

ENV RH_VERSION=2.0.5
ENV RH_VERSION=2.0.6
ENV OMNISERVICEIP 127.0.0.1

LABEL name="REDHAWK SDR Base Image" \
Expand Down
5 changes: 2 additions & 3 deletions Dockerfiles/bu353s4.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime:2.0.5
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="Geon Technology's BU353S4 GPS Device" \
description="Geon's BU353S4" \
maintainer="Thomas Goodwin <[email protected]>"
description="Geon's BU353S4"

ENV DOMAINNAME ""
ENV GPS_PORT ""
Expand Down
6 changes: 3 additions & 3 deletions Dockerfiles/development.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime:2.0.5
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="REDHAWK IDE Environment" \
description="REDHAWK Integrated Development Environment Runner" \
maintainer="Thomas Goodwin <[email protected]>"
description="REDHAWK Integrated Development Environment Runner"

ENV RHUSER_ID 54321

Expand All @@ -39,6 +38,7 @@ ADD files/build/base-deps-func.sh \
files/build/redhawk-source-repo-func.sh \
files/build/build-sh-process-func.sh \
files/build/standard-sdrroot.sh \
files/build/ide-fetcher.py \
files/build/ide.sh \
./
RUN bash standard-sdrroot.sh && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/domain.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime:2.0.5
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="REDHAWK SDR Domain" \
description="REDHAWK SDR Domain Runner"

Expand Down
53 changes: 53 additions & 0 deletions Dockerfiles/files/build/ide-fetcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/python
# Author: Thomas Goodwin <[email protected]>

import urllib2, json, os, sys, re

def download_asset(path, url):
asset_path = None
try:
file_name = os.path.basename(url)
asset_path = os.path.join(path, file_name)

if os.path.exists(asset_path):
# Skip downloading
asset_path = None
else:
if not os.path.exists(path):
os.makedirs(path)

f = urllib2.urlopen(url)
with open(asset_path, "wb") as local_file:
local_file.write(f.read())

except Exception as e:
sys.exit('Failed to fetch IDE. Error: {0}'.format(e))
finally:
return asset_path

def handle_release_assets(assets):
assets = [ asset for asset in assets if re.match(r'redhawk-ide.+?(?=x86_64)', asset['name'])]
if not assets:
sys.exit('Failed to find the IDE asset')
elif len(assets) > 1:
sys.exit('Found too many IDE assets matching that description...?')
return download_asset('downloads', assets[0]['browser_download_url'])

def run(pv):
RELEASES_URL = 'http://api.github.com/repos/RedhawkSDR/redhawk/releases'
ide_asset = ''
try:
releases = json.loads(urllib2.urlopen(RELEASES_URL).read())
releases = [r for r in releases if r['tag_name'] == pv]
if releases:
ide_asset = handle_release_assets(releases[0]['assets'])
else:
sys.exit('Failed to find the release: {0}'.format(pv))

finally:
return ide_asset

if __name__ == '__main__':
# First argument is the version
asset = run(sys.argv[1])
print asset
13 changes: 11 additions & 2 deletions Dockerfiles/files/build/ide.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,18 @@ install_build_deps

# Download the IDE
INSTALL_DIR="${OSSIEHOME}/../ide/${RH_VERSION}"
IDE_URL="https://github.com/RedhawkSDR/redhawk/releases/download/2.0.5/redhawk-ide-2.0.5.R201702021445-linux.gtk.x86_64.tar.gz"
mkdir -p ${INSTALL_DIR} && pushd ${INSTALL_DIR}
wget -qO- ${IDE_URL} | tar xvz
IDE_ASSET="$(python /tmp/build/ide-fetcher.py ${RH_VERSION})"
if ! [ $? -eq 0 ]; then
echo "Failed to download IDE" 1>&2
exit 1
fi

# Unpack the asset
echo "Unpacking: ${IDE_ASSET}"
ls -la ${IDE_ASSET}
tar xvzf ${IDE_ASSET}
rm -rf ${IDE_ASSET}
ln -s $PWD/eclipse/eclipse /usr/bin/rhide
popd

Expand Down
7 changes: 3 additions & 4 deletions Dockerfiles/gpp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime:2.0.5
LABEL version="2.0.5" \
description="REDHAWK GPP Runner" \
maintainer="Thomas Goodwin <[email protected]>"
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="REDHAWK GPP Device" \
description="REDHAWK GPP Runner"

ENV DOMAINNAME ""
ENV NODENAME ""
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/omniserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-base:2.0.5
FROM geontech/redhawk-ubuntu-base:2.0.6

LABEL name="OmniORB Servers" \
description="Omni* Services Runner"
Expand Down
5 changes: 2 additions & 3 deletions Dockerfiles/rtl2832u.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime:2.0.5
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="REDHAWK SDR RTL2832U Device" \
description="REDHAWK RTL2832U" \
maintainer="Thomas Goodwin <[email protected]>"
description="REDHAWK RTL2832U"

ENV DOMAINNAME ""
ENV RTL_NAME ""
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/runtime.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-base:2.0.5
FROM geontech/redhawk-ubuntu-base:2.0.6
LABEL name="REDHAWK SDR Runtime" \
description="REDHAWK SDR Runtime dependencies (core framework, etc.)"

Expand Down
5 changes: 2 additions & 3 deletions Dockerfiles/usrp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime:2.0.5
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="REDHAWK SDR USRP_UHD Device" \
description="REDHAWK USRP_UHD w/ updated UHD driver version (3.10)" \
maintainer="Thomas Goodwin <[email protected]>"
description="REDHAWK USRP_UHD w/ updated UHD driver version (3.10)"

ENV DOMAINNAME ""
ENV NODENAME ""
Expand Down
5 changes: 2 additions & 3 deletions Dockerfiles/webserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

FROM geontech/redhawk-ubuntu-runtime
FROM geontech/redhawk-ubuntu-runtime:2.0.6
LABEL name="REST-Python Web Server" \
description="Geon's Fork of REST-Python" \
maintainer="Thomas Goodwin <[email protected]>"
description="Geon's Fork of REST-Python"

# Build-time configurable variables
ARG REST_PYTHON=http://github.com/GeonTech/rest-python.git
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

VERSION := 2.0.5
VERSION := 2.0.6

image_prefix := geontech/redhawk-ubuntu
base := $(image_prefix)-base
Expand Down

0 comments on commit 2de451e

Please sign in to comment.