threefoldtecharchive / jumpscaleX_libs

Apache License 2.0
0 stars 2 forks source link

Several sal docker issues #29

Closed Pishoy closed 4 years ago

Pishoy commented 5 years ago

Several issues:

  1. I am testing build method when i use flag output as it by default is True gives the same output as flag is False
    • dockerfile under /root/build
FROM ubuntu:14.04
RUN  apt-get update \
  && apt-get install -y wget \
  && rm -rf /var/lib/apt/lists/*
j.sal.docker.build('/root/build',tag='ubuntu:testBishoy') 
j.sal.docker.images_remove('ubuntu:testBishoy')
j.sal.docker.build('/root/build',tag='ubuntu:testBishoy',output=False)  
  1. also another issue when trying to create a docker container it fail as below:
JSX> j.sal.docker.create(name='test')                                                                                                                                                                       
Mon 21 15:57:24 sal/docker/Docker.py - 406 - create                             : EXCEPTION: 
    Could not create docker, res:'{'Id': '0c80f28322bf455efd2c9947a98e51abb301b13fba45dbad68a319cab37b1dd0', 'Warnings':
        []}'
--TRACEBACK------------------
<stdin> in <module>
    1    
/sandbox/lib/jumpscale/JumpscaleLibs/sal/docker/Docker.py in create
    406    raise j.exceptions.RuntimeError("Could not create docker, res:'%s'" % res)
-----------------------------
  1. a third issue is i got error when trying to use method status while there is a two docker containers (one up and second is down) as below :
3BOTDEVEL:jsxtesting:~: docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
45bb96cf662c        ubuntu:18.04        "bash"              3 minutes ago       Exited (0) 41 seconds ago                       testubunut
aaf31904f766        ubuntu:14.04        "bash"              8 hours ago         Up 7 hours                                      remove

3BOTDEVEL:jsxtesting:~: kosmos

JSX> j.sal.docker.status()                                                                           
Tue 22 16:55:29 /docker/Container.py - 116 - public_port_get                    : EXCEPTION: 
    docker docker:testubunut is not running cannot get pub port.
--TRACEBACK------------------
<stdin> in <module>
    1    
/sandbox/lib/jumpscale/JumpscaleLibs/sal/docker/Docker.py in status
    144    res.append([item.name, item.image, item.ssh_port, item.status])
/sandbox/lib/jumpscale/JumpscaleLibs/sal/docker/Container.py in ssh_port
    36    self._ssh_port = self.public_port_get(22)
/sandbox/lib/jumpscale/JumpscaleLibs/sal/docker/Container.py in public_port_get
    116    raise j.exceptions.RuntimeError("docker %s is not running cannot get pub port." % self)
-----------------------------

None
JSX>  
  1. 4th issue is i got error when pushing an image using push method as below :
    
    3BOTDEVEL:jsxtesting:~: docker images ubuntu:testBishoy
    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
    ubuntu              testBishoy          52139e600a70        28 hours ago        194MB

3BOTDEVEL:jsxtesting:~: kosmos

JSX> j.sal.docker.push('ubuntu:testBishoy')
Tue 22 17:02:53 sal/docker/Docker.py - 541 - push : EXCEPTION: denied: requested access to the resource is denied --TRACEBACK------------------

in 1 /sandbox/lib/jumpscale/JumpscaleLibs/sal/docker/Docker.py in push 541 raise j.exceptions.RuntimeError(message) ----------------------------- None ```
xmonader commented 4 years ago

not blocking current installation, for later.

serboctor commented 4 years ago

I moved all the comments stating other problems to the main description

serboctor commented 4 years ago

For the first issue, when output is True you'll see the progress logs in the logging panel.

serboctor commented 4 years ago

For the 4th issue, you can't push to the ubuntu repo, this is not something that you have access to. I tested the push with an image that I own and it works fine (after logging in using docker login of course) Screenshot from 2020-01-28 15-35-44

serboctor commented 4 years ago

Issue 2 and 3 are fixed by this https://github.com/threefoldtech/jumpscaleX_libs/pull/59

Dina-Abd-Elrahman commented 4 years ago