adhuliya / ajit-toolchain

Toolchains for AJIT Processor IIT Bombay
8 stars 4 forks source link

Running the docker images in marshal branch #10

Closed saurabhb17 closed 3 years ago

saurabhb17 commented 3 years ago

By following steps given in the README files, and running the certain scripts, I found out that docker group needs to be created and added to my user. After doing that by following said steps, I started from scratch Step-1 source ./ajit_home_env Step-2 ./docker_setup.sh Step-3 ./build.sh This yielded following message:

saurabh@saurabh-HP-Laptop-15g-br1xx:~/ajit/ajit-toolchain/docker/ajit_base$ ./build.sh Sending build context to Docker daemon 12.29kB Step 1/6 : FROM ubuntu:16.04 ---> dfeff22e96ae Step 2/6 : ENV AJIT_HOME /home/ajit/ajit-toolchain ---> Using cache ---> ce3083bf0cf4 Step 3/6 : COPY setup_ajit_base.sh $AJIT_HOME/ ---> Using cache ---> 94392b4277b9 Step 4/6 : RUN bash $AJIT_HOME/setup_ajit_base.sh ---> Running in 09a83784cd72 Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease Temporary failure resolving 'security.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. Reading package lists... Building dependency tree... Reading state information... Package perl is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: perl-base

Package cpio is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: tar

Package bzip2 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Unable to locate package make E: Unable to locate package binutils E: Unable to locate package build-essential E: Unable to locate package gcc E: Unable to locate package patch E: Package 'bzip2' has no installation candidate E: Package 'perl' has no installation candidate E: Package 'cpio' has no installation candidate E: Unable to locate package unzip E: Unable to locate package rsync E: Unable to locate package file E: Unable to locate package bc E: Unable to locate package wget E: Unable to locate package vim-tiny E: Unable to locate package python E: Unable to locate package python3 E: Unable to locate package scons E: Unable to locate package openjdk-8-jre-headless The command '/bin/sh -c bash $AJIT_HOME/setup_ajit_base.sh' returned a non-zero code: 100


How to resolve this?

adhuliya commented 3 years ago

Did the Step 2 ./docker_setup.sh work fine? The Step 3 ./build.sh, from which folder are you running it? That is not required. I will add the documentation to add the current user to the docker group.

saurabhb17 commented 3 years ago

yes, the step 2 worked fine.

Produced following message:/usr/bin/docker Good. Docker is installed!

Output log file: /home/saurabh/ajit/ajit-toolchain/build/docker_build.log

~/ajit/ajit-toolchain/docker/ajit_base ~/ajit/ajit-toolchain ~/ajit/ajit-toolchain ~/ajit/ajit-toolchain/docker/ajit_build ~/ajit/ajit-toolchain ~/ajit/ajit-toolchain ~/ajit/ajit-toolchain/docker/ajit_tools ~/ajit/ajit-toolchain ~/ajit/ajit-toolchain

I ran the build.sh from docker/ajit_base/ directory. After the build.sh gave warnings, I tried running run.sh: Got this response ->

saurabh@saurabh-HP-Laptop-15g-br1xx:~/ajit/ajit-toolchain/docker/ajit_base$ ./run.sh Ajit: Removing any container with name 'ajit_base' Error: No such container: ajit_base Ajit: Starting container with name 'ajit_base' Unable to find image 'ajit_base:1.0' locally docker: Error response from daemon: pull access denied for ajit_base, repository does not exist or may require 'docker login'. See 'docker run --help'. Ajit: Docker container started? Status: 125

adhuliya commented 3 years ago

please show me the output of docker image ls

saurabhb17 commented 3 years ago

saurabh@saurabh-HP-Laptop-15g-br1xx:~/ajit/ajit-toolchain$ docker image ls

REPOSITORY TAG IMAGE ID CREATED SIZE

94392b4277b9 About an hour ago 131MB ubuntu 16.04 dfeff22e96ae 2 weeks ago 131MB
adhuliya commented 3 years ago

Okay this shows that the images were not created. Please refer to the log file ./build/docker_build.log. Can you send me the file?

saurabhb17 commented 3 years ago

https://drive.google.com/file/d/1acs1K52rBNOdw8_xnaw3TAHMsFJ3bsUU/view?usp=sharing

adhuliya commented 3 years ago

I am unable to access the file via the url. I have requested access though, on the form that google presented.

adhuliya commented 3 years ago

Okay. The file shows the following error: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock Hence no images are getting created.

I believe you must have created a docker group and added yourself to it, with commands similar to,

sudo groupadd docker;
sudo usermod -aG docker ${USER};

If so, then you need to logout and login again to let that take effect. Then the issue should not arise. I will add a script to help user do the same. The issue is that the docker is not setup and installed properly (i.e. not given correct permissions).

In any case you can always run docker with sudo and things would work nicely, without needing all these steps.

saurabhb17 commented 3 years ago

I logged out and logged in but the build log was showing the same permission denied message. I even rebooted and followed the necessary steps, no avail!

In any case you can always run docker with sudo and things would work nicely, without needing all these steps.

I am completely new to dockers so can you elaborate this? docker_setup.sh is going to create the docker images through the build.sh using the docker build --tag $_IMG_NAME:${TAG} command.

Shall I change this last line to sudo docker build --tag $_IMG_NAME:${TAG} and try again? Is that what you were trying to convey?

adhuliya commented 3 years ago

Effectively you need to setup docker such that you can issue the docker command without the sudo permission.

If that's not the case you can always use sudo. So use,

sudo ./docker_setup.sh;

Though, I would not recommend using sudo. Make sure that when you use sudo the AJIT_HOME env is accessible in the sudoed environment. Or become root with sudo su and then issue all the commands.

saurabhb17 commented 3 years ago

went with sudo su:

  1. source ajit_home_env
  2. ./docker_steup.sh

attached log here, daemon socket error is not there, but packages are still not being fetched.

docker_build.log

adhuliya commented 3 years ago

AFAIK these errors occur when the system cannot connect to the internet. Are you running these commands on a remote machine. If so you may need to login to the internet.iitb.ac.in on that remote machine to access the internet.

saurabhb17 commented 3 years ago

switched over to another WiFi network and the ajit_base dependencies seem to be getting solved. sorry about all the noise. I will close this once all images are built.

VishnuEaswaran commented 3 years ago

@saurabhb17 did you succeed in building the images??

saurabhb17 commented 3 years ago

Yes, I was able to build the images

On Fri, Nov 13, 2020, 2:29 PM Vishnu Easwaran E notifications@github.com wrote:

@saurabhb17 https://github.com/saurabhb17 did you succeed in building the images??

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adhuliya/ajit-toolchain/issues/10#issuecomment-726637592, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKQCOVFRPV4HSOYJ57WIS4DSPTYOLANCNFSM4TS3X2DA .

saurabhb17 commented 3 years ago

I did face some issues while running ajit_build.sh, though:

Ajit: Removing any container with name 'ajit_build' Error: No such container: ajit_build Ajit: Starting container with name 'ajit_build' Unable to find image 'ajit_build:1.0' locally docker: Error response from daemon: pull access denied for ajit_build, repository does not exist or may require 'docker login'. See 'docker run --help'. Ajit: Docker container started? Status: 125

This was after running the run.sh in docker/ajit_build/

For ajit_base, I am able to get in the container, open a shell and execute commands