eclipse / iottestware

Eclipse Public License 1.0
10 stars 12 forks source link

Docker Build fails: unable to connect to git.eclipse.org #22

Closed seriousme closed 1 year ago

seriousme commented 3 years ago

Hi,

I'm trying to build the IOT Testware Docker container following the quickstart guide, however I get:

Step 10/22 : RUN git clone https://github.com/eclipse/iottestware && /bin/bash -c "source /etc/bash.bashrc" && sudo chmod 777 /home/titan/iottestware/install.py
 ---> Using cache
 ---> b20b698ceb9d
Step 11/22 : RUN python /home/titan/iottestware/install.py -p mqtt -b --path /home/titan/Titan && python /home/titan/iottestware/install.py -p coap -b --path /home/titan/Titan
 ---> Running in be3ef67af193
fatal: unable to connect to git.eclipse.org:
git.eclipse.org[0: 198.41.30.196]: errno=Connection timed out

Getting dependencies ...
 IoT-Testware ... done!
 Test ports ... done!
Traceback (most recent call last):
  File "/home/titan/iottestware/install.py", line 286, in <module>
    Main()
  File "/home/titan/iottestware/install.py", line 280, in Main
    install(args.protocol)
  File "/home/titan/iottestware/install.py", line 200, in install
    os.chdir(PATH_PROTOCOL)
OSError: [Errno 2] No such file or directory: '/home/titan/Titan/ProtocolModules/MQTT/'
The command '/bin/sh -c python /home/titan/iottestware/install.py -p mqtt -b --path /home/titan/Titan && python /home/titan/iottestware/install.py -p coap -b --path /home/titan/Titan' returned a non-zero code: 1

It looks like git.eclipse.org is no longer accessible over git. e.g.:

git ls-remote git://git.eclipse.org/gitroot/titan/titan.ProtocolModules.MQTT.git
fatal: unable to connect to git.eclipse.org:
git.eclipse.org[0: 198.41.30.196]: errno=Connection timed out

Any help would be appreciated.

Kind regards, Hans

alexanderkaiser commented 3 years ago

Hi @seriousme,

looks like Titan has already moved their modules to GitLab.

I assume we'd need to adopt the new repositories within install.py

Would you be able to provide a pull request for that issue?

seriousme commented 3 years ago

FYI: I'm running into nodejs issues further on.

The dashboard uses binary dependencies on Node.js 8.x which is not supported by recent versions of NPM anymore (current Node.js is at 16, with LTS at 14)

This can be resolved by dropping the:

## Update npm
RUN npm i -g npm

From the Docker file.

It does leave us however with: found 1929 vulnerabilities (580 low, 116 moderate, 1226 high, 7 critical)

I also tried to use eclipsetitan/titan-ubuntu:7.2.0 but that also resulted in issues as Nodejs 8.x is not supported on Ubuntu Focal Fossa.

It would be nice if someone would update the tooling to a more current version of the tools ;-)

Kind regards, Hans

alexanderkaiser commented 3 years ago

@seriousme thank you for your PR, appreciate your support.

We haven't touched the Testware for quite a long time now. Could you give Node.js 16/14 a try in the Dockerfile

However, I have to dissapoint you with the issue about the found vulnerabilities. The whole npm ecosystem evolves very fast and new vulnerabilities are discovered on a daily basis. Unfortunately, we don't have the resources to keep up with speed, the Dashboard itself was never intended to be a production-ready tool but rather a PoC to showcase the capabilities of the IoT-Testware (in a less-technical manner). So if you are concerned about the npm-vulnerabilites in your environment, I would suggest you to use the IoT-Testware without the Dashboard (docs might help you)

seriousme commented 3 years ago

@alexanderkaiser

I did try both 14 and 16, but they failed because of binary dependencies (nodejs binary interface has changed), if I recall correctly the problem was with node-sass. Node-sass is no longer supported anymore so I could not find a newer version compatible with newer versions of node.

The life of node js apps can be prolongued a bit by avoiding binary dependencies and using githubs dependabot to keep your dependencies "green". However as with any software it tends to rust if you don't touch it ;-)

I finally got the dashboard to work and it helped me quash a few bugs in my Typescript implementation of an MQTT server, so thanks for that !

I'm not promising anything, but would you be interested in a more modern version of the dashboard ? (recreating it with 2021 techniques should not be too hard ;-))

Kind regards, Hans

seriousme commented 3 years ago

Ok, could not resist trying a bit more ;-)

npm uninstall node-sass
npm install node-sass --save-dev 

Installs node-sass version 6.0.1 which compiles the bundle correctly! (both on Nodejs 14 and on Nodejs 16 ;-))

Currently running a docker build with node16, if that works I will submit a PR on iottestware.dashboard.

Cheers, Hans

seriousme commented 3 years ago

I looked at doing a webpack production build which would alleviate the need for all the dev dependencies but could not get that easily to work. Doing a full upgrade of dependencies breaks on things like primereact/growl being replaced by primereact/toast.

Kind regards, Hans

alexanderkaiser commented 2 years ago

Hi @seriousme I see, you were really hardworking.

However as with any software it tends to rust if you don't touch it ;-)

Unfortunately :(

I finally got the dashboard to work and it helped me quash a few bugs in my Typescript implementation of an MQTT server, so thanks for that !

I'm very happy to hear that, especially after the rocky path you had with the Dashboard.

I'm not promising anything, but would you be interested in a more modern version of the dashboard ? (recreating it with 2021 techniques should not be too hard ;-))

Well, to be honest, I'm not very familiar with modern web-technologies (as you may have guessed already) and cannot really estimate the required effort. But indeed, it should be easier to implement the dashboard from scratch. (The dependencies to Titan/IoT-Testware are pretty manageable)

It would be up to you to decide if you want to invest the effort.