threefoldtecharchive / jumpscaleX_archived

Apache License 2.0
1 stars 6 forks source link

traefik buider: start method always reset installation and sandbox fail #656

Closed Dinaamagdy closed 5 years ago

Dinaamagdy commented 5 years ago

Steps

j.builder.web.traefik.build() j.builder.web.traefik.install() j.builder.web.traefik.start()

Issue

always start method , install things again and clone traefik again as shown image

Dinaamagdy commented 5 years ago

and sandbox method to fail with the following error

    || mkdir -p '/sandbox/var/log'
make[2]: Leaving directory '/tmp/builders/openresty/openresty/build/nginx-1.13.6'
make[1]: Leaving directory '/tmp/builders/openresty/openresty/build/nginx-1.13.6'
mkdir -p /sandbox/openresty/site/lualib /sandbox/openresty/site/pod /sandbox/openresty/site/manifest
ln -sf /sandbox/bin/openresty /sandbox/openresty/bin/openresty
+ rm -rf /tmp/builders/openresty
+ rm -f /sandbox/bin/lua
+ ln -s /sandbox/openresty/luajit/bin/luajit /sandbox/bin/lua
Wed 26 13:42:34 uilderBaseClass.py - 318 - builderopenresty:builderopenresty  : sandbox profile path in:/sandbox/env.sh
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/sandbox/lib/jumpscale/Jumpscale/builder/system/BuilderBaseClass.py", line 166, in wrapper_action
    res = self.apply_method(func, kwargs)
  File "/sandbox/lib/jumpscale/Jumpscale/builder/system/BuilderBaseClass.py", line 93, in apply_method
    return func(**kwargs)
  File "/sandbox/lib/jumpscale/Jumpscale/builder/web/BuilderTraefik.py", line 109, in sandbox
    j.builders.web.openresty.sandbox(reset=reset)
  File "/sandbox/lib/jumpscale/Jumpscale/builder/system/BuilderBaseClass.py", line 166, in wrapper_action
    res = self.apply_method(func, kwargs)
  File "/sandbox/lib/jumpscale/Jumpscale/builder/system/BuilderBaseClass.py", line 93, in apply_method
    return func(**kwargs)
  File "/sandbox/lib/jumpscale/Jumpscale/builder/web/BuilderOpenResty.py", line 127, in sandbox
    self._copy(dir_src, dir_dest)
  File "/sandbox/lib/jumpscale/Jumpscale/builder/system/BuilderBaseClass.py", line 416, in _copy
    createdir=True,
  File "/sandbox/lib/jumpscale/Jumpscale/builder/tools/BuilderTools.py", line 115, in copyTree
    createdir=createdir,
  File "/sandbox/lib/jumpscale/Jumpscale/sal/fs/SystemFS.py", line 265, in copyDirTree
    if ":" not in src and j.sal.fs.isDir(src):
  File "/sandbox/lib/jumpscale/Jumpscale/sal/fs/SystemFSDecorators.py", line 154, in wrapper
    raise ValueError(msg)
ValueError: Argument path in j.sal.fs.isDir expects an existing path value! /sandbox/bin/resty does not exist.

Argument path in j.sal.fs.isDir expects an existing path value! /sandbox/bin/resty does not exist.
despiegk commented 5 years ago

later no immediate requirement

ranatrk commented 5 years ago

install and start updated, start doesnt redo install unless install wasn't complete https://github.com/threefoldtech/jumpscaleX/commit/e6c9d19df39af9a5d0cf7264db7daff968736028

ranatrk commented 5 years ago

In Traefik builder, in sandbox() , openresty.sandbox() is called. The error /sandbox/bin/resty does not exist is because resty is added using lua builder, and so sandboxing resty should be done in lua builder instead of openresty builder.

ranatrk commented 5 years ago

Fix in openresty: https://github.com/threefoldtech/jumpscaleX/commit/bcd69a618d68dcbd20c75228251b6f9446f616c2 [development_jumpscale]

command run with no error: j.builders.web.traefik.sandbox()

siddiquagig commented 5 years ago

First part verified, build, install and start are now working fine:

traefikrana

Will test the sandbox now

Pishoy commented 5 years ago

snadbox is verified and flist was uploaded and i create a container by the generated flist, then i checked the binary inside created container as below and was working

/sandbox/bin/traefik
root@testtearfik:~# ls /sandbox/bin/traefik  -l
-rwxr-x--- 1 root root 69963136 Jul 29 14:16 /sandbox/bin/traefik
root@testtearfik:~# /sandbox/bin/traefik --help
traefik is a modern HTTP reverse proxy and load balancer made to deploy microservices with ease.
Complete documentation is available at https://traefik.io

Usage: traefik [flags] <command> [<arguments>]

Use "traefik <command> --help" for help on any command.