Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.

Conversation

@ricarkol
Copy link
Contributor

@ricarkol ricarkol commented Jul 21, 2018

Use libisofs (as a shared library) instead of the genisoimage command. This is better than using the genisoimage command because the compiler doesn't complain if genisoimage is not installed, and that can lead to failures like in issue #22. If the libisofs-dev package is not present, go build will clearly complain that libisofs.h is not present.

Copy link
Member

@lumjjb lumjjb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM. 2 small build comments, we need to figure out a way to propagate the error.

1. Ensure that your `GOPATH` is set. (https://github.com/golang/go/wiki/SettingGOPATH)
2. Go get the repo `go get github.com/nabla-containers/runnc`
3. Install genisoimage on host `sudo apt install genisoimage`
3. Install libisofs on host `sudo apt install libisofs-dev`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this may potentially break the container-build, can you verify that it still works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with the latest commit.

0. Install libisofs on host
```
sudo apt install genisoimage
sudo apt install libisofs-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think that if the developer skips this step now, they actually won't see any error since OCI doesn't propagate it unless it's in a log file. I tried this with removing a library from it:

lumjjb@lumjjb-ThinkPad-P50:/usr/local/bin$ sudo mv /lib/x86_64-linux-gnu/libseccomp.so.2 ~/.
lumjjb@lumjjb-ThinkPad-P50:/usr/local/bin$ ldd runnc
	linux-vdso.so.1 =>  (0x00007fff7a5bc000)
	libseccomp.so.2 => not found
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcf9d525000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fcf9d8ef000)
lumjjb@lumjjb-ThinkPad-P50:/usr/local/bin$ sudo docker run --rm --runtime=runnc nablact/node-express-nabla
docker: Error response from daemon: OCI runtime create failed: unable to retrieve OCI runtime error (open /run/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/ae631e5c0e29037b30c8b9f03c149490841e880d832ed645064a713400f08e99/log.json: no such file or directory): /usr/local/bin/runnc did not terminate sucessfully: unknown.
lumjjb@lumjjb-ThinkPad-P50:/usr/local/bin$ ./runnc
./runnc: error while loading shared libraries: libseccomp.so.2: cannot open shared object file: No such file or directory
lumjjb@lumjjb-ThinkPad-P50:/usr/local/bin$

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea with this change is checking libisofs at build time, not really at runtime. In any case, at runtime, we would have to check for other libraries as well, like all the ones that runnc depends on and libseccomp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, genisoimage is still used for tests.

Ricardo Koller added 9 commits July 24, 2018 09:10
Signed-off-by: Ricardo Koller <[email protected]>
- also move createDummy (disk) from nabla-lib/storage to runnc-cont so
  runnc-cont doesn't have to link against libisofs.

Signed-off-by: Ricardo Koller <[email protected]>
Signed-off-by: Ricardo Koller <[email protected]>
Signed-off-by: Ricardo Koller <[email protected]>
Signed-off-by: Ricardo Koller <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants