diff --git a/Dockerfiles/base.Dockerfile b/Dockerfiles/base.Dockerfile index 96f6b3f..6ebaa8b 100644 --- a/Dockerfiles/base.Dockerfile +++ b/Dockerfiles/base.Dockerfile @@ -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" \ diff --git a/Dockerfiles/bu353s4.Dockerfile b/Dockerfiles/bu353s4.Dockerfile index 1c12daf..6588708 100644 --- a/Dockerfiles/bu353s4.Dockerfile +++ b/Dockerfiles/bu353s4.Dockerfile @@ -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 " + description="Geon's BU353S4" ENV DOMAINNAME "" ENV GPS_PORT "" diff --git a/Dockerfiles/development.Dockerfile b/Dockerfiles/development.Dockerfile index 709bc7c..734ddb2 100644 --- a/Dockerfiles/development.Dockerfile +++ b/Dockerfiles/development.Dockerfile @@ -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 " + description="REDHAWK Integrated Development Environment Runner" ENV RHUSER_ID 54321 @@ -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 && \ diff --git a/Dockerfiles/domain.Dockerfile b/Dockerfiles/domain.Dockerfile index bac3f26..8acc56f 100644 --- a/Dockerfiles/domain.Dockerfile +++ b/Dockerfiles/domain.Dockerfile @@ -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" diff --git a/Dockerfiles/files/build/ide-fetcher.py b/Dockerfiles/files/build/ide-fetcher.py new file mode 100644 index 0000000..714ebd7 --- /dev/null +++ b/Dockerfiles/files/build/ide-fetcher.py @@ -0,0 +1,53 @@ +#!/usr/bin/python +# Author: Thomas Goodwin + +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 \ No newline at end of file diff --git a/Dockerfiles/files/build/ide.sh b/Dockerfiles/files/build/ide.sh index af89bef..1959c28 100644 --- a/Dockerfiles/files/build/ide.sh +++ b/Dockerfiles/files/build/ide.sh @@ -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 diff --git a/Dockerfiles/gpp.Dockerfile b/Dockerfiles/gpp.Dockerfile index e52a2f2..50e169a 100644 --- a/Dockerfiles/gpp.Dockerfile +++ b/Dockerfiles/gpp.Dockerfile @@ -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 " +FROM geontech/redhawk-ubuntu-runtime:2.0.6 +LABEL name="REDHAWK GPP Device" \ + description="REDHAWK GPP Runner" ENV DOMAINNAME "" ENV NODENAME "" diff --git a/Dockerfiles/omniserver.Dockerfile b/Dockerfiles/omniserver.Dockerfile index 9267d42..1778e5e 100644 --- a/Dockerfiles/omniserver.Dockerfile +++ b/Dockerfiles/omniserver.Dockerfile @@ -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" diff --git a/Dockerfiles/rtl2832u.Dockerfile b/Dockerfiles/rtl2832u.Dockerfile index 2715885..b75cd1f 100644 --- a/Dockerfiles/rtl2832u.Dockerfile +++ b/Dockerfiles/rtl2832u.Dockerfile @@ -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 " + description="REDHAWK RTL2832U" ENV DOMAINNAME "" ENV RTL_NAME "" diff --git a/Dockerfiles/runtime.Dockerfile b/Dockerfiles/runtime.Dockerfile index 6303bf9..4166c20 100644 --- a/Dockerfiles/runtime.Dockerfile +++ b/Dockerfiles/runtime.Dockerfile @@ -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.)" diff --git a/Dockerfiles/usrp.Dockerfile b/Dockerfiles/usrp.Dockerfile index f5528b0..38431bf 100644 --- a/Dockerfiles/usrp.Dockerfile +++ b/Dockerfiles/usrp.Dockerfile @@ -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 " + description="REDHAWK USRP_UHD w/ updated UHD driver version (3.10)" ENV DOMAINNAME "" ENV NODENAME "" diff --git a/Dockerfiles/webserver.Dockerfile b/Dockerfiles/webserver.Dockerfile index 1c210f4..f1cbed1 100644 --- a/Dockerfiles/webserver.Dockerfile +++ b/Dockerfiles/webserver.Dockerfile @@ -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 " + description="Geon's Fork of REST-Python" # Build-time configurable variables ARG REST_PYTHON=http://github.com/GeonTech/rest-python.git diff --git a/Makefile b/Makefile index 2293188..a9f8d7b 100644 --- a/Makefile +++ b/Makefile @@ -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