always build gui
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Christoph Honal 2020-02-14 01:55:31 +01:00
parent 4f61ba3800
commit 65e4ccebc1
11 changed files with 36 additions and 306 deletions

View File

@ -1,66 +0,0 @@
global-variables:
default_environment: &default_environment
PROP_SERVER_USER:
from_secret: prop_server_user
PROP_SERVER_KEY:
from_secret: prop_server_key
PROP_SERVER:
from_secret: prop_server
PROP_DIR_SDR:
from_secret: prop_dir_sdr
PROP_DIR_DECODER:
from_secret: prop_dir_decoder
default_settings: &default_settings
build_args_from_env:
- PROP_SERVER
- PROP_DIR_SDR
- PROP_DIR_DECODER
- PROP_SERVER_USER
- PROP_SERVER_KEY
- UI_MODE
username:
from_secret: docker_username
password:
from_secret: docker_password
repo: registry.chrz.de:443/move2docker
registry: registry.chrz.de:443
kind: pipeline
name: default
steps:
- name: build-cli
image: plugins/docker
depends_on: [ clone ]
environment:
<<: *default_environment
UI_MODE: cli
settings:
<<: *default_settings
commands:
- export DOCKER_CLI_EXPERIMENTAL=enabled
- docker buildx ls
- name: build-gui
image: plugins/docker
depends_on: [ clone ]
environment:
<<: *default_environment
UI_MODE: gui
settings:
<<: *default_settings
commands:
- export DOCKER_CLI_EXPERIMENTAL=enabled
- docker buildx ls
- name: notify
image: drillster/drone-email
depends_on: [ build-cli, build-gui ]
settings:
host: smtp
port: 25
skip_verify: true
from: drone@chrz.de
when:
status: [ success, failure ]

View File

@ -1,27 +1,3 @@
global-variables:
default_environment: &default_environment
PROP_SERVER_USER:
from_secret: prop_server_user
PROP_SERVER_KEY:
from_secret: prop_server_key
PROP_SERVER:
from_secret: prop_server
PROP_DIR_SDR:
from_secret: prop_dir_sdr
PROP_DIR_DECODER:
from_secret: prop_dir_decoder
default_commands:
- &cmd_setup
docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 &&
docker buildx create --use --name crosscomp &&
docker buildx inspect --bootstrap
- &cmd_build
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --output=type=image,push=true --progress tty
--build-arg UI_MODE --build-arg PROP_SERVER --build-arg PROP_SERVER_USER
--build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER
-t registry.chrz.de:443/move2docker:$UI_MODE-multi .
volumes: volumes:
- name: docker_socket - name: docker_socket
host: host:
@ -32,29 +8,30 @@ kind: pipeline
name: default name: default
steps: steps:
- name: build-cli - name: build
image: alexviscreanu/buildx image: alexviscreanu/buildx
volumes: volumes:
- name: docker_socket - name: docker_socket
path: /var/run/docker.sock path: /var/run/docker.sock
commands: commands:
- *cmd_setup - docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64
- *cmd_build - docker buildx create --use --name crosscomp
- docker buildx inspect --bootstrap
- docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 --output=type=image,push=true --progress tty
--build-arg PROP_SERVER --build-arg PROP_SERVER_USER
--build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER
-t registry.chrz.de:443/move2docker:multi .
environment: environment:
<<: *default_environment PROP_SERVER_USER:
UI_MODE: cli from_secret: prop_server_user
PROP_SERVER_KEY:
- name: build-gui from_secret: prop_server_key
image: alexviscreanu/buildx PROP_SERVER:
volumes: from_secret: prop_server
- name: docker_socket PROP_DIR_SDR:
path: /var/run/docker.sock from_secret: prop_dir_sdr
commands: PROP_DIR_DECODER:
- *cmd_setup from_secret: prop_dir_decoder
- *cmd_build
environment:
<<: *default_environment
UI_MODE: gui
- name: notify - name: notify
image: drillster/drone-email image: drillster/drone-email

View File

@ -1,5 +1,3 @@
ARG UI_MODE=cli
# Donwnload stage # Donwnload stage
FROM ubuntu:18.04 AS download FROM ubuntu:18.04 AS download
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
@ -33,44 +31,35 @@ RUN git clone https://github.com/MOVE-II/move2radio.git && \
# Base stage with deps # Base stage with deps
FROM ubuntu:18.04 AS base-cli FROM ubuntu:18.04 AS base
ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin ENV DEBIAN_FRONTEND=noninteractive TZ=Europe/Berlin
# Setup build deps # Setup build deps
RUN apt-get update && \ RUN apt-get update && \
apt-get -y install --no-install-recommends build-essential git cmake autoconf automake unzip libtool-bin pkgconf libssl-dev \ apt-get -y install --no-install-recommends build-essential git cmake autoconf automake unzip libtool-bin pkgconf libssl-dev \
python2.7 python-pip python3 python3-pip python-cheetah libcppunit-dev swig uuid-dev libusb-1.0-0-dev \ python2.7 python-pip python3 python3-pip python-cheetah libcppunit-dev swig uuid-dev libusb-1.0-0-dev \
python-mako libzmq3-dev libcomedi-dev python-sip-dev python-six socat && \ python-mako libzmq3-dev libcomedi-dev python-sip-dev python-six socat \
rm -rf /var/lib/apt/lists/* python-numpy python-wxgtk3.0 libzmq3-dev \
# Base stage with GUI deps
FROM base-cli as base-gui
# Setup grc and gui deps
RUN apt-get update && \
apt-get -y install --no-install-recommends python-numpy python-wxgtk3.0 libzmq3-dev \
libqt4-opengl-dev python-qt4 libqwt-dev python-gtk2 python-lxml && \ libqt4-opengl-dev python-qt4 libqwt-dev python-gtk2 python-lxml && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Build stage # Build stage
FROM base-${UI_MODE} AS build FROM base AS build
# Copy sources # Copy sources
COPY --from=download /app /app COPY --from=download /app /app
# Build sources # Build sources
WORKDIR /app/move2radio WORKDIR /app/move2radio
ARG UI_MODE=cli COPY build/CMakeLists.txt /app/move2radio/CMakeLists.txt
COPY build/CMakeLists.${UI_MODE}.txt /app/move2radio/CMakeLists.txt
RUN mkdir build && cd build && \ RUN mkdir build && cd build && \
cmake -DAPPIMAGE=OFF -DCONDA_ENV=OFF -DLDPC_OFFLINE=ON -DGR_CCSDS_OFFLINE=ON -DOFFLINE_DEPENDENCY_PATH=/app/move2radio-prop .. && \ cmake -DAPPIMAGE=OFF -DCONDA_ENV=OFF -DLDPC_OFFLINE=ON -DGR_CCSDS_OFFLINE=ON -DOFFLINE_DEPENDENCY_PATH=/app/move2radio-prop .. && \
make move2radio make move2radio
# Run stage # Run stage
FROM base-${UI_MODE} AS run FROM base AS run
# Copy sources from build stage # Copy sources from build stage
COPY --from=build /app/move2radio/build/prefix/usr /app/move2radio/build/prefix/usr COPY --from=build /app/move2radio/build/prefix/usr /app/move2radio/build/prefix/usr
@ -82,9 +71,8 @@ ENV PATH="/app/move2radio/build/prefix/usr/bin:${PATH}" \
# Install binaries # Install binaries
COPY build/blocks/* app/move2radio/build/prefix/usr/share/gnuradio/grc/blocks/ COPY build/blocks/* app/move2radio/build/prefix/usr/share/gnuradio/grc/blocks/
COPY build/fakeserver/* /app/fakeserver/ COPY build/fakeserver/* /app/fakeserver/
ARG UI_MODE=cli COPY build/run*.sh /app/
COPY build/run-${UI_MODE}.sh /app/run.sh
RUN chmod 644 app/move2radio/build/prefix/usr/share/gnuradio/grc/blocks/*.xml && \ RUN chmod 644 app/move2radio/build/prefix/usr/share/gnuradio/grc/blocks/*.xml && \
chmod +x /app/run.sh && ldconfig chmod +x /app/run*.sh && ldconfig
ENTRYPOINT ["/app/run.sh"] ENTRYPOINT ["/app/run-cli.sh"]

View File

@ -1,4 +1,6 @@
# Move2Docker # Move2Docker
[![Build Status](https://drone.chrz.de/api/badges/chonal/move2docker/status.svg)](https://drone.chrz.de/chonal/move2docker)
MOVE-II decoder docker container for all the architectures your heart desires - x86_64, armv7l, ... MOVE-II decoder docker container for all the architectures your heart desires - x86_64, armv7l, ...
Based on https://github.com/MOVE-II/move2radio. Based on https://github.com/MOVE-II/move2radio.

View File

@ -1,166 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
PROJECT(move2radio
LANGUAGES C
DESCRIPTION "Portable Version of the MOVE-II groundstation")
INCLUDE(ExternalProject)
IF(UNIX AND NOT APPLE)
SET(LINUX TRUE)
ENDIF()
INCLUDE(cmake/options.cmake)
INCLUDE(cmake/system_deps.cmake)
INCLUDE(cmake/build_autotools.cmake)
INCLUDE(cmake/build_cmake.cmake)
INCLUDE(cmake/build_meson.cmake)
SET(DEPS_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps")
SET(BUILD_PATH "${CMAKE_CURRENT_BINARY_DIR}/build")
SET(PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}/prefix")
FILE(MAKE_DIRECTORY ${DEPS_PATH}/src)
SET(ENV{PKG_CONFIG_PATH} ${PREFIX_PATH}/usr/lib/pkgconfig)
SET(PKG_CONFIG_PATH ENV{PKG_CONFIG_PATH})
## Custom target deps makes sure all sources are there
ADD_CUSTOM_TARGET(deps)
IF(NOT ${NO_DOWNLOAD})
ADD_CUSTOM_TARGET(download)
ADD_DEPENDENCIES(deps download)
ENDIF()
## move2deps.cmake contains all sources
INCLUDE(cmake/dependency.cmake)
INCLUDE(cmake/move2deps.cmake)
ADD_CUSTOM_TARGET(delete_prefix
${CMAKE_COMMAND} -E remove_directory ${PREFIX_PATH})
ADD_CUSTOM_TARGET(prefix
${CMAKE_COMMAND} -E make_directory ${PREFIX_PATH}/usr/share
COMMAND echo \"CFLAGS=-I${PREFIX_PATH}/usr/include\\nLDFLAGS=\\\"-L${PREFIX_PATH}/usr/lib -Wl,-rpath=${PREFIX_PATH}/usr/lib\\\"\\n\" > ${PREFIX_PATH}/config.site
COMMAND rm -f ${PREFIX_PATH}/usr/lib/libuuid.*
COMMAND find / -not -path \"${CMAKE_CURRENT_BINARY_DIR}/*\" -name \"libuuid*.so*\" -exec ln -sf {} ${PREFIX_PATH}/usr/lib/libuuid.so \\\\; 2>/dev/null || [ -e ${PREFIX_PATH}/usr/lib/libuuid.so ])
### Anaconda deploys a portable python + pygtk,numpy,pyqt ###
INCLUDE(cmake/anaconda.cmake)
INCLUDE(ProcessorCount)
PROCESSORCOUNT(N)
FIND_PROGRAM(MAKE make)
FIND_PROGRAM(MESON meson)
FIND_PROGRAM(NINJA ninja)
### Build all sources ###
# Boost and ldpc Build is more complicated. Moved to own file
INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/ldpc.cmake)
MOVEII_BUILD_AUTOTOOLS(fftw EXTRA_OPTIONS --enable-threads --enable-float)
MOVEII_BUILD_AUTOTOOLS(gsl)
MOVEII_BUILD_AUTOTOOLS(libiconv)
MOVEII_BUILD_AUTOTOOLS(rtl-sdr)
MOVEII_BUILD_AUTOTOOLS(gmp)
MOVEII_BUILD_AUTOTOOLS(rxvt-unicode EXTRA_OPTIONS --disable-perl --enable-xft CONFIG_SITE ON)
MOVEII_BUILD_AUTOTOOLS(ntl NO_DEFAULT ON SOURCE_SUFFIX "/src" COPY_SOURCE ON
EXTRA_OPTIONS NTL_GMP_LIP=on SHARED=on NATIVE=off DEF_PREFIX=${PREFIX_PATH}/usr)
MOVEII_BUILD_AUTOTOOLS(ncurses)
MOVEII_BUILD_CMAKE(airspy)
MOVEII_BUILD_CMAKE(gr-osmosdr)
MOVEII_BUILD_CMAKE(curl EXTRA_OPTIONS -DCMAKE_USE_OPENSSL=ON)
MOVEII_BUILD_CMAKE(curlpp)
MOVEII_BUILD_CMAKE(gr-ccsds)
MOVEII_BUILD_CMAKE(gr-iqbal)
MOVEII_BUILD_CMAKE(libosmosdr)
MOVEII_BUILD_CMAKE(bladerf EXTRA_OPTIONS -DINSTALL_UDEV_RULES=OFF)
MOVEII_BUILD_CMAKE(libmirisdr)
MOVEII_BUILD_CMAKE(soapysdr)
MOVEII_BUILD_CMAKE(hackrf SOURCE_SUFFIX "/host/")
MOVEII_BUILD_CMAKE(gr-fcdproplus)
MOVEII_BUILD_CMAKE(freesrp)
MOVEII_BUILD_CMAKE(libuhd EXTRA_OPTIONS -DENABLE_E100=ON -DENABLE_E300=ON -DENABLE_EXAMPLES=OFF -DENABLE_TESTS=OFF -DENABLE_UTILS=OFF SOURCE_SUFFIX "/host")
MOVEII_BUILD_CMAKE(gnuradio EXTRA_OPTIONS
-DENABLE_INTERNAL_VOLK=ON
-DENABLE_DEFAULT=OFF
-DENABLE_VOLK=ON
-DENABLE_GNURADIO_RUNTIME=ON
-DENABLE_PYTHON=ON
-DENABLE_GR_AUDIO=ON
-DENABLE_GR_BLOCKS=ON
-DENABLE_GR_FILTER=ON
-DENABLE_GR_FFT=ON
-DENABLE_GR_UHD=OFF
-DENABLE_GR_FCD=OFF
-DENABLE_GR_ANALOG=ON
-DENABLE_GR_WAVELET=ON
-DENABLE_GRC=OFF
-DENABLE_GR_QTGUI=OFF
-DENABLE_GR_DIGITAL=ON)
ADD_DEPENDENCIES(build_gnuradio build_boost build_gsl build_fftw build_libiconv)
MOVEII_BUILD_AUTOTOOLS(fec NO_AUTORECONF ON NO_INSTALL ON)
## fec is to dumb to properly install:
ADD_CUSTOM_COMMAND(OUTPUT ${PREFIX_PATH}/usr/lib/libfec.so
COMMAND ${CMAKE_COMMAND} -E copy ${FEC_SOURCE}/fec.h ${PREFIX_PATH}/usr/include/fec.h
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_PATH}/fec/libfec.a ${PREFIX_PATH}/usr/lib/libfec.a
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_PATH}/fec/libfec.so ${PREFIX_PATH}/usr/lib/libfec.so
DEPENDS build_fec
)
ADD_CUSTOM_TARGET(install_fec
DEPENDS ${PREFIX_PATH}/usr/lib/libfec.so)
## Get the dependencies between the sources right:
ADD_DEPENDENCIES(build_gr_osmosdr build_rtl_sdr build_gnuradio)
ADD_DEPENDENCIES(build_ntl build_gmp)
ADD_DEPENDENCIES(build_curlpp build_curl)
ADD_DEPENDENCIES(install_fec prefix)
ADD_DEPENDENCIES(build_gr_ccsds install_fec build_gnuradio build_ldpc build_curlpp)
ADD_DEPENDENCIES(build_gr_fcdproplus build_gnuradio)
ADD_CUSTOM_TARGET(move2radio)
ADD_DEPENDENCIES(move2radio build_gr_ccsds build_gr_osmosdr)
ADD_DEPENDENCIES(build_libuhd build_boost build_ncurses)
ADD_DEPENDENCIES(build_hackrf build_fftw)
ADD_DEPENDENCIES(build_freesrp build_boost)
ADD_DEPENDENCIES(build_rxvt_unicode build_ncurses)
IF(APPIMAGE)
ADD_EXECUTABLE(AppRun AppDir/AppRun.c)
SET(APPDIR ${CMAKE_CURRENT_BINARY_DIR}/AppDir)
FILE(MAKE_DIRECTORY ${APPDIR})
IF(EXISTS ${APPDIR})
FILE(REMOVE_RECURSE ${APPDIR})
ENDIF()
ADD_CUSTOM_COMMAND(OUTPUT ${APPDIR}/AppRun
COMMAND cp -r ${PREFIX_PATH} ${APPDIR}
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APPDIR}/usr/include
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APPDIR}/usr/pkgs
COMMAND ${CMAKE_COMMAND} -E remove_directory ${APPDIR}/usr/ssl
COMMAND rm -rf ${APPDIR}/usr/lib/libuuid.so*
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/AppDir ${APPDIR}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/AppRun ${APPDIR}/AppRun
DEPENDS AppRun move2radio build_rxvt_unicode)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/squashfs-root/AppRun
COMMAND chmod +x ${DEPS_PATH}/src/appimagetool-x86_64.AppImage
COMMAND ${DEPS_PATH}/src/appimagetool-x86_64.AppImage --appimage-extract
DEPENDS appimagetool)
ADD_CUSTOM_TARGET(appimagetool_extract
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/squashfs-root/AppRun)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Gnuradio_Companion-x86_64.AppImage
COMMAND env ARCH=x86_64 ${CMAKE_CURRENT_BINARY_DIR}/squashfs-root/AppRun ${APPDIR}
DEPENDS appimagetool_extract ${APPDIR}/AppRun)
ADD_CUSTOM_TARGET(appimage_build
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Gnuradio_Companion-x86_64.AppImage)
ADD_DEPENDENCIES(appimage appimage_build)
ENDIF()

View File

@ -4,8 +4,7 @@ cd "${0%/*}/.."
source ./config/config.sh source ./config/config.sh
export PROP_SERVER_KEY=$(cat ./config/id_rsa) export PROP_SERVER_KEY=$(cat ./config/id_rsa)
export UI_MODE=$1
docker build \ docker build \
--build-arg UI_MODE --build-arg PROP_SERVER --build-arg PROP_SERVER_USER \ --build-arg PROP_SERVER --build-arg PROP_SERVER_USER \
--build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER \ --build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER \
-t registry.chrz.de:443/move2docker:$UI_MODE-$(arch) . -t registry.chrz.de:443/move2docker:$(arch) .

View File

@ -4,9 +4,8 @@ cd "${0%/*}/.."
source ./config/config.sh source ./config/config.sh
export PROP_SERVER_KEY=$(cat ./config/id_rsa) export PROP_SERVER_KEY=$(cat ./config/id_rsa)
export UI_MODE=$1
docker buildx build \ docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \ --platform linux/amd64,linux/arm64,linux/arm/v7 \
--build-arg UI_MODE --build-arg PROP_SERVER --build-arg PROP_SERVER_USER \ --build-arg PROP_SERVER --build-arg PROP_SERVER_USER \
--build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER \ --build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER \
-t registry.chrz.de:443/move2docker:$UI_MODE-multi . -t registry.chrz.de:443/move2docker:multi .

View File

@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
export UI_MODE=$1 docker pull registry.chrz.de:443/move2docker:$(arch)
docker pull registry.chrz.de:443/move2docker:$UI_MODE-$(arch)

View File

@ -1,4 +1,3 @@
#!/bin/bash #!/bin/bash
export UI_MODE=$1 docker push registry.chrz.de:443/move2docker-$(arch)
docker push registry.chrz.de:443/move2docker:$UI_MODE-$(arch)

View File

@ -3,8 +3,7 @@
cd "${0%/*}/.." cd "${0%/*}/.."
source ./config/config.sh source ./config/config.sh
export UI_MODE=$1
docker run -it --rm \ docker run -it --rm \
-v $(pwd)/data:/app/data:rw \ -v $(pwd)/data:/app/data:rw \
--env DISPLAY=host.docker.internal:0.0 \ --env DISPLAY=host.docker.internal:0.0 \
registry.chrz.de:443/move2docker:$UI_MODE-$(arch) registry.chrz.de:443/move2docker:$(arch)