greatspn / SOURCES

Main repository of the GreatSPN framework
GNU General Public License v2.0
42 stars 13 forks source link

docker do.sh build failures #8

Closed millergarym closed 4 years ago

millergarym commented 4 years ago

The docker build is failing. Some of the failures encountered are network time-outs. Once past the transient failures there is a persistent failure, output included below.

I'll have a go at writing an idiomatic dockerfile by exploding download.sh.

Source version: 69dbebb341801dc0f3721e475d7b77c1f049adb5 Thu Nov/07 21:18:37 (HEAD -> master, origin/master, origin/HEAD) fix in docker script [Amparore]

$ ./do.sh build
Sending build context to Docker daemon  4.096kB
Step 1/9 : FROM fedora
 ---> f0858ad3febd
Step 2/9 : RUN dnf -y install git
 ---> Using cache
 ---> 484a061bc6b9
Step 3/9 : RUN (curl -H 'Cache-Control: no-cache'         https://raw.githubusercontent.com/greatspn/SOURCES/master/download.sh |    iconv -f latin1 | bash -s -- -Fedora  -only-deps -dont-install)
 ---> Using cache
 ---> f419e737471e
Step 4/9 : RUN (curl -H 'Cache-Control: no-cache'         https://raw.githubusercontent.com/greatspn/SOURCES/master/download.sh |           iconv -f latin1 | MKFLAGS="-j 4" bash -s -- -docker -dont-install -dont-build )
 ---> Using cache
 ---> 0304c451718a
Step 5/9 : RUN (curl -H 'Cache-Control: no-cache'         https://raw.githubusercontent.com/greatspn/SOURCES/master/download.sh |           iconv -f latin1 | MKFLAGS="-j 4" bash -s -- -docker  )
 ---> Running in ca8e172a78a9
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9479  100  9479    0     0  26403      0 --:--:-- --:--:-- --:--:-- 26330
===============================================================================
GreatSPN Framework v3.0 installation script
===============================================================================

===============================================================================
Installing required GreatSPN dependencies..
===============================================================================

...

    [javac]   where E is a type-variable:
    [javac]     E extends Object declared in class JComboBox
    [javac] 3 warnings
[j2seproject1:jar] error while reading original manifest in file: /GreatSPN/SOURCES/JavaGUI/Editor/dist/Editor.jar due to error in opening zip file

BUILD SUCCESSFUL
Total time: 6 seconds
  [MAKE] Java GUI (MacOSX App Bundle)
  [MAKE] Java GUI (Linux Tar)
  [MAKE] Java GUI (Generic Jars)
  [LEX]  NSRC/DSPN-Tool/lexer.ll
  [LEX]  NSRC/DSPN-Tool/lexer.ll
  [C++]  NSRC/DSPN-Tool/CSLTA.cpp
  [C++]  NSRC/DSPN-Tool/DTA.cpp
  [C++]  NSRC/DSPN-Tool/PetriNet.cpp
  [C++]  objects/DSPN-Tool/NSRC/DSPN-Tool/lexer.ll.cpp
  [C++]  objects/DSPN-Tool-Debug/NSRC/DSPN-Tool/lexer.ll.cpp
  [LD]   bin/DSPN-Tool
  [LD]   bin/DSPN-Tool-Debug
make: Target 'all' not remade because of errors.

 Error: Could not compile GreatSPN. Check the log for errors.

 Error: Could not compile and install the GreatSPN framework.

The command '/bin/sh -c (curl -H 'Cache-Control: no-cache'        https://raw.githubusercontent.com/greatspn/SOURCES/master/download.sh |           iconv -f latin1 | MKFLAGS="-j 4" bash -s -- -docker  )' returned a non-zero code: 1
amparore commented 4 years ago

I am not sure the error you are encountering is due to network timeout. It is probably due to a build error (I see a Java build issue in your log, but the reason is not in the part you posted). We know that GreatSPN should build on Fedora and some Ubuntu, maybe you are using a Linux with some difference in the library directories? Anyway, we designed the docker file to use a build script exactly to avoid having to maintain both a script and a dockerfile separately, with the same content. Therefore, I am not willing to merge an exploded dockerfile.

amparore commented 4 years ago

I have looked instead at the /usr/lib64 dependencies you have put in the diff Makefile. I have pushed a change in the Makefile that should fix the build process for you. Could you please confirm if it builds now?

millergarym commented 4 years ago

@amparore thanks for the changes, they fixed the build issues.

we designed the docker file to use a build script exactly to avoid having to maintain both a script and a dockerfile separately, with the same content.

I might be missing something. As I see it the download.sh script complicates things.

With the fedora.docker file the build instruction become

  1. clone greatspn/SOURCE
  2. docker build -t gpsn -f docker/fedora.dockerfile .

The built artifacts can be packaged inside the container and released, or the container can be pushed to docker hub.

millergarym commented 4 years ago

Push a docker image to https://hub.docker.com/repository/docker/millergarym/greatspn

Quick way to get GreatSPN running (at least from a Linux machine with X on display :0)

XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -ti --rm \
    -v $XSOCK:$XSOCK \
    -v $XAUTH:$XAUTH \
    -e XAUTHORITY=$XAUTH \
    -e HOME=/usr/local/GreatSPN/models/usermodels \
    -e U_USER=$USER \
    -e U_UID=`id -u` \
    -e U_GID=`id -g` \
    -v `pwd`:/usr/local/GreatSPN/models/usermodels \
    -w /usr/local/GreatSPN/models//usermodels \
    millergarym/greatspn