Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename 'NodeOS' to 'nodeos' and set absolute path #266

Closed
wants to merge 1 commit into from
Closed

Rename 'NodeOS' to 'nodeos' and set absolute path #266

wants to merge 1 commit into from

Conversation

luii
Copy link
Member

@luii luii commented Jun 27, 2016

Like in the other file (dockerBuild) we need to change the name to lowercase. And after this docker complains about absolute paths for this i put a slash infront of the userfs variable.

After this i get this error we already discussed #227:

λ philipp [~/Dokumente/NodeOS] at  master !?
→ npm run docker                                                                                          [e16936d]

> NodeOS@1.0.0-RC2 docker /home/philipp/Dokumente/NodeOS
> scripts/docker

mount procfs: Operation not permitted
mount devtmpfs: Operation not permitted
fs.js:1048
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '/proc/mounts' -> '/etc/mtab'
    at Error (native)
    at Object.fs.symlinkSync (fs.js:1048:18)
    at /lib/node_modules/nodeos-mount-filesystems/server.js:381:6
    at /lib/node_modules/nodeos-mount-filesystems/node_modules/mkdirp/index.js:48:26
    at FSReqWrap.oncomplete (fs.js:117:15)
/proc/sched_debug: Operation not permitted
/proc/timer_stats: Operation not permitted
/proc/kcore: Operation not permitted
/proc/sysrq-trigger: Operation not permitted
/proc/sys: Operation not permitted
/proc/irq: Operation not permitted
/proc/fs: Operation not permitted
/proc/bus: Operation not permitted
/proc/asound: Operation not permitted
/dev/console: Operation not permitted
/dev/shm: Operation not permitted
/etc/hosts: Operation not permitted
/etc/hostname: Operation not permitted
/etc/resolv.conf: Operation not permitted
/dev/sda: Operation not permitted
/dev/mqueue: Operation not permitted
/sys/fs/cgroup/blkio: Operation not permitted
/sys/fs/cgroup/cpuset: Operation not permitted
/sys/fs/cgroup/pids: Operation not permitted
/sys/fs/cgroup/freezer: Operation not permitted
/sys/fs/cgroup/devices: Operation not permitted
/sys/fs/cgroup/memory: Operation not permitted
/sys/fs/cgroup/net_cls: Operation not permitted
/sys/fs/cgroup/cpu,cpuacct: Operation not permitted
/sys/fs/cgroup/systemd: Operation not permitted
/sys/fs/cgroup: Operation not permitted
/sys: Operation not permitted
/dev/pts: Operation not permitted
/dev: Operation not permitted
/proc: Operation not permitted
/: Operation not permitted
termination: Operation not permitted

npm ERR! Linux 4.6.2-1-ARCH
npm ERR! argv "/home/philipp/.nvm/versions/node/v5.12.0/bin/node" "/home/philipp/.nvm/versions/node/v5.12.0/bin/npm" "run" "docker"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! NodeOS@1.0.0-RC2 docker: `scripts/docker`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the NodeOS@1.0.0-RC2 docker script 'scripts/docker'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the NodeOS package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     scripts/docker
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs NodeOS
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls NodeOS
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/philipp/Dokumente/NodeOS/npm-debug.log

IMAGE=NodeOS
USERSFS=out/latest/usersfs
IMAGE=nodeos
USERSFS=/out/latest/usersfs
Copy link
Member

Choose a reason for hiding this comment

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

Are the paths absolute from the current working dir? That's strange...

Copy link
Member Author

Choose a reason for hiding this comment

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

i dont know but thats the only time i dont get a validation error like this:

docker: Error response from daemon: create out/latest/usersfs: "out/latest/usersfs" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed.
See 'docker run --help'.

Or if the path is relative i get a error that says that docker needs a absolute path

Copy link
Member

Choose a reason for hiding this comment

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

Ok, it seems that if it doesn't start by a slash it think we are going to use a Docker volume... What a sh*t.

@piranna
Copy link
Member

piranna commented Jun 27, 2016

λ philipp [~/Dokumente/NodeOS] at  master !?
→ npm run docker [e16936d]

NodeOS@1.0.0-RC2 docker /home/philipp/Dokumente/NodeOS
scripts/docker

mount procfs: Operation not permitted
mount devtmpfs: Operation not permitted
fs.js:1048
return binding.symlink(preprocessSymlinkDestination(target, type, path),
^

Error: EEXIST: file already exists, symlink '/proc/mounts' -> '/etc/mtab'
at Error (native)
at Object.fs.symlinkSync (fs.js:1048:18)
at /lib/node_modules/nodeos-mount-filesystems/server.js:381:6
at /lib/node_modules/nodeos-mount-filesystems/node_modules/mkdirp/index.js:48:26
at FSReqWrap.oncomplete (fs.js:117:15)

This is a problem on Docker about permissions for mounting filesystems. I didn't have time to take a look, but seems it's now feasable by enabling some capabilities when executing Docker. Could you be able to review it?

/proc/sched_debug: Operation not permitted
/proc/timer_stats: Operation not permitted
/proc/kcore: Operation not permitted
/proc/sysrq-trigger: Operation not permitted
/proc/sys: Operation not permitted
/proc/irq: Operation not permitted
/proc/fs: Operation not permitted
/proc/bus: Operation not permitted
/proc/asound: Operation not permitted
/dev/console: Operation not permitted
/dev/shm: Operation not permitted
/etc/hosts: Operation not permitted
/etc/hostname: Operation not permitted
/etc/resolv.conf: Operation not permitted
/dev/sda: Operation not permitted
/dev/mqueue: Operation not permitted
/sys/fs/cgroup/blkio: Operation not permitted
/sys/fs/cgroup/cpuset: Operation not permitted
/sys/fs/cgroup/pids: Operation not permitted
/sys/fs/cgroup/freezer: Operation not permitted
/sys/fs/cgroup/devices: Operation not permitted
/sys/fs/cgroup/memory: Operation not permitted
/sys/fs/cgroup/net_cls: Operation not permitted
/sys/fs/cgroup/cpu,cpuacct: Operation not permitted
/sys/fs/cgroup/systemd: Operation not permitted
/sys/fs/cgroup: Operation not permitted
/sys: Operation not permitted
/dev/pts: Operation not permitted
/dev: Operation not permitted
/proc: Operation not permitted
/: Operation not permitted
termination: Operation not permitted

At least the unmouning of the filesystems done by nodeos-init it's working like a charm... :-) Should I remove that harmless messages? Should I print them on stderr?

@piranna
Copy link
Member

piranna commented Jun 27, 2016

Should I print them on stderr?

I think it's done already because they are printed by using perror(), but who knows...

@luii
Copy link
Member Author

luii commented Jun 27, 2016

@piranna I changed the path to a real absolute path (/home/philipp/Dokumente/NodeOS/out/latest/usersfs)
and got this:

 npm run docker                                                                                          [cb2c59d]

> NodeOS@1.0.0-RC2 docker /home/philipp/Dokumente/NodeOS
> scripts/docker

mount procfs: Resource busy
fs.js:1048
  return binding.symlink(preprocessSymlinkDestination(target, type, path),
                 ^

Error: EEXIST: file already exists, symlink '/proc/mounts' -> '/etc/mtab'
    at Error (native)
    at Object.fs.symlinkSync (fs.js:1048:18)
    at /lib/node_modules/nodeos-mount-filesystems/server.js:381:6
    at /lib/node_modules/nodeos-mount-filesystems/node_modules/mkdirp/index.js:48:26
    at FSReqWrap.oncomplete (fs.js:117:15)
/: Resource busy

I also add the privileged flag, do you think its trying to mount my root partition?

@piranna
Copy link
Member

piranna commented Jun 27, 2016

Here we have two problems, one about not being able to mount procfs and devtmpfs (first because a lack of permissions and now because the resource is busy, probably because it's already mounted), and another one because the /etc/mtab symlink could not be created, probably because it's already provided by Docker. Could you be able ignore the error on nodeos-mount-filesystems to see if it works?

@piranna
Copy link
Member

piranna commented Jun 27, 2016

Exactly the problem is at https://github.com/NodeOS/nodeos-mount-filesystems/blob/82f8c07f0327cf57f916692034892a3f0b78defa/server.js#L381-L382, where fs.symlinkSync() is throwing and exception on error. Could you be able to confirm that both entries are provided by Docker? If so, I could be able to ignore that error.

@luii
Copy link
Member Author

luii commented Jun 27, 2016

@piranna somehow i now get some errors and i dont know why

Successfully generated nodeos user folder
cp: reguläre Datei '/home/philipp/Dokumente/NodeOS/node_modules/nodeos-usersfs/out/nocona/barebones.tar' kann nicht angelegt werden: Datei oder Verzeichnis nicht gefunden

npm ERR! Linux 4.6.2-1-ARCH
npm ERR! argv "/home/philipp/.nvm/versions/node/v5.12.0/bin/node" "/home/philipp/.nvm/versions/node/v5.12.0/bin/npm" "run" "build"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! nodeos-usersfs@1.0.0-RC2 build: `scripts/build`
npm ERR! Exit status 30
npm ERR! 
npm ERR! Failed at the nodeos-usersfs@1.0.0-RC2 build script 'scripts/build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nodeos-usersfs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     scripts/build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs nodeos-usersfs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls nodeos-usersfs
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/philipp/Dokumente/NodeOS/node_modules/nodeos-usersfs/npm-debug.log
Error compiling ''
dirname: fehlender Operand
„dirname --help“ liefert weitere Informationen.
rmdir: fehlender Operand
„rmdir --help“ liefert weitere Informationen.

npm ERR! Linux 4.6.2-1-ARCH
npm ERR! argv "/home/philipp/.nvm/versions/node/v5.12.0/bin/node" "/home/philipp/.nvm/versions/node/v5.12.0/bin/npm" "run" "build"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! NodeOS@1.0.0-RC2 build: `scripts/build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the NodeOS@1.0.0-RC2 build script 'scripts/build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the NodeOS package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     scripts/build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs NodeOS
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls NodeOS
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/philipp/Dokumente/NodeOS/npm-debug.log

as always i already tried a clean install
edit: this only happens when i try to build with PLATFORM=docker npm run build

@luii
Copy link
Member Author

luii commented Jun 27, 2016

@piranna a small update on this
i changed the nodeos-mount-filesystem in nodeosDependencies to luii/nodeos-mount-filesystem which contains the changed files

→ npm run docker                                                                                          [daace86]

> NodeOS@1.0.0-RC2 docker /home/philipp/Dokumente/NodeOS
> scripts/docker

mount procfs: Operation not permitted
mount devtmpfs: Operation not permitted
{ Error: EPERM, Operation not permitted 'proc'
    at Error (native) errno: 1, code: 'EPERM', path: 'proc', syscall: 'mount' }
Could not find userfs: Error: PARTUUID=d7da3845-7e88-4930-8ce6-6c4e9d679f07 not exists
    at /lib/node_modules/nodeos-mount-filesystems/server.js:245:38
    at FSReqWrap.cb [as oncomplete] (fs.js:251:19)
prompt: path to userfs:  

Docker is indeed trying to mount the root partition.

@piranna
Copy link
Member

piranna commented Jun 27, 2016

edit: this only happens when i try to build with PLATFORM=docker npm run build

Docker is a bit unmaintained at this moment, you are being a pioneer here ;-)

i changed the nodeos-mount-filesystem in nodeosDependencies to luii/nodeos-mount-filesystem which contains the changed files

Try to rebase your changes and I'll accept them.

Docker is indeed trying to mount the root partition.

Define the root environment variable (although npm run docker should do itself...).

@luii
Copy link
Member Author

luii commented Jun 27, 2016

Define the root environment variable (although npm run docker should do itself...).

Already done, this is the output:

→ npm run docker                                                                                                                         [daace86]

> NodeOS@1.0.0-RC2 docker /home/philipp/Dokumente/NodeOS
> scripts/docker

mount procfs: Resource busy
{ Error: EBUSY, Resource busy 'proc'
    at Error (native) errno: 16, code: 'EBUSY', path: 'proc', syscall: 'mount' }
Trace: { Error: ENOENT: no such file or directory, scandir '/tmp'
    at Error (native) errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/tmp' }
    at onerror (/lib/node_modules/nodeos-mount-filesystems/server.js:37:13)
    at done (/lib/node_modules/nodeos-mount-filesystems/server.js:225:5)
    at /lib/node_modules/nodeos-mount-filesystems/server.js:231:22
    at FSReqWrap.oncomplete (fs.js:117:15)
Starting REPL session
NodeOS-mount-filesystems> 

@piranna
Copy link
Member

piranna commented Jun 27, 2016

{ Error: EBUSY, Resource busy 'proc' at Error (native) errno: 16, code: 'EBUSY', path: 'proc', syscall: 'mount' }

procfs was already mount by nodeos-init, if you rebase your changes this will not appear anymore.

Trace: { Error: ENOENT: no such file or directory, scandir '/tmp' at Error (native) errno: -2, code: 'ENOENT', syscall: 'scandir', path: '/tmp' } at onerror (/lib/node_modules/nodeos-mount-filesystems/server.js:37:13) at done (/lib/node_modules/nodeos-mount-filesystems/server.js:225:5) at /lib/node_modules/nodeos-mount-filesystems/server.js:231:22 at FSReqWrap.oncomplete (fs.js:117:15) Starting REPL session NodeOS-mount-filesystems>

Could you be able to check on the REPL what's the content of the root filesystem (fs.readdirSync('/'))? It's strange that there's no /tmp folder, nor generated by NodeOS or by Docker...

@luii
Copy link
Member Author

luii commented Jun 27, 2016

Could you be able to check on the REPL what's the content of the root filesystem fs.readdirSync('/'))?

Starting REPL session
NodeOS-mount-filesystems> var fs = require('fs')
undefined
NodeOS-mount-filesystems> fs.readdirSync('/')
[ '.dockerenv', 'bin', 'dev', 'etc', 'lib', 'proc', 'sys' ]
NodeOS-mount-filesystems>

I also inspected the etc folder with the mtab in it and got this:

/dev/mapper/docker-8:51-6818048-ba0d7069ed771157e9b6e81c7b34a45337f359369f0726aa4ab923ed5b2c7240 / xfs rw,relatime,nouuid,attr2,inode64,logbsize=64k,sunit=128,swidth=128,noquota 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666 0 0
sysfs /sys sysfs ro,nosuid,nodev,noexec,relatime 0 0
tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,relatime,mode=755 0 0
cgroup /sys/fs/cgroup/systemd cgroup ro,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd 0 0
cgroup /sys/fs/cgroup/cpu,cpuacct cgroup ro,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0
cgroup /sys/fs/cgroup/net_cls cgroup ro,nosuid,nodev,noexec,relatime,net_cls 0 0
cgroup /sys/fs/cgroup/memory cgroup ro,nosuid,nodev,noexec,relatime,memory 0 0
cgroup /sys/fs/cgroup/devices cgroup ro,nosuid,nodev,noexec,relatime,devices 0 0
cgroup /sys/fs/cgroup/freezer cgroup ro,nosuid,nodev,noexec,relatime,freezer 0 0
cgroup /sys/fs/cgroup/pids cgroup ro,nosuid,nodev,noexec,relatime,pids 0 0
cgroup /sys/fs/cgroup/cpuset cgroup ro,nosuid,nodev,noexec,relatime,cpuset 0 0
cgroup /sys/fs/cgroup/blkio cgroup ro,nosuid,nodev,noexec,relatime,blkio 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
/dev/sdc1 /dev/sda ext4 rw,relatime,data=ordered 0 0
/dev/sdd3 /etc/resolv.conf ext4 rw,relatime,data=ordered 0 0
/dev/sdd3 /etc/hostname ext4 rw,relatime,data=ordered 0 0
/dev/sdd3 /etc/hosts ext4 rw,relatime,data=ordered 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime,size=65536k 0 0
devpts /dev/console devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
proc /proc/asound proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/bus proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/fs proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/irq proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sys proc ro,nosuid,nodev,noexec,relatime 0 0
proc /proc/sysrq-trigger proc ro,nosuid,nodev,noexec,relatime 0 0
tmpfs /proc/kcore tmpfs rw,nosuid,mode=755 0 0
tmpfs /proc/timer_stats tmpfs rw,nosuid,mode=755 0 0
tmpfs /proc/sched_debug tmpfs rw,nosuid,mode=755 0 0

@piranna
Copy link
Member

piranna commented Jun 27, 2016

(@luii, I've cleaned the output of /etc/mtab file)

@piranna
Copy link
Member

piranna commented Jun 27, 2016

Could you be able to check on the REPL what's the content of the root filesystem fs.readdirSync('/'))?

Starting REPL session
NodeOS-mount-filesystems> var fs = require('fs')
undefined
NodeOS-mount-filesystems> fs.readdirSync('/')
[ '.dockerenv', 'bin', 'dev', 'etc', 'lib', 'proc', 'sys' ]
NodeOS-mount-filesystems>

So seems in fact /tmp don't exists... Seems the problem came from https://github.com/NodeOS/nodeos-mount-filesystems/blob/82f8c07f0327cf57f916692034892a3f0b78defa/server.js#L230, trying to read the content of the users folder, that should be mounted or defined at https://github.com/NodeOS/nodeos-mount-filesystems/blob/82f8c07f0327cf57f916692034892a3f0b78defa/server.js#L323-L347. Is the root environment variable set to container? This will make it assume that's already mounted in /tmp by Docker. Maybe the Dockerfile is wrong?

@luii
Copy link
Member Author

luii commented Jun 28, 2016

I'll look into this and do the pioneer work for this

@mitsukaki
Copy link
Contributor

@luii fantastic :)

@luii
Copy link
Member Author

luii commented Jun 29, 2016

@piranna i've digged more into the node.js repl from nodeos-mount-filesystems and i was wondering why even the linux kernel has the PARTUUID of my root embedded into /proc/cmdline

NodeOS-mount-filesystems> fs.readFileSync('/proc/cmdline')
<Buffer 69 6e 69 74 72 64 3d 5c 69 6e 69 74 72 61 6d 66 73 2d 6c 69 6e 75 78 2e 69 6d 67 20 72 6f 6f 74 3d 50 41 52 54 55 55 49 44 3d 64 37 64 61 33 38 34 35 ... >
NodeOS-mount-filesystems> var cmdline = fs.readFileSync('/proc/cmdline')
undefined
NodeOS-mount-filesystems> cmdline.toString()
> 'initrd=\\initramfs-linux.img root=PARTUUID=d7da3845-7e88-4930-8ce6-6c4e9d679f07\n'
NodeOS-mount-filesystems> 

@piranna
Copy link
Member

piranna commented Jun 29, 2016

Because Docker expose the '/proc' of the host system, including the cmdline
whom the system was started. That's why I added a check for the environment
variable 'root' to override it.

If you want to document it... :-D
El 29/6/2016 21:14, "Philipp Czarnetzki" notifications@github.com
escribió:

@piranna https://github.com/piranna i've digged more into the node.js
repl from nodeos-mount-filesystems and i was wondering why even the linux
kernel has the PARTUUID embedded into /proc/cmdline

NodeOS-mount-filesystems> fs.readFileSync('/proc/cmdline')<Buffer 69 6e 69 74 72 64 3d 5c 69 6e 69 74 72 61 6d 66 73 2d 6c 69 6e 75 78 2e 69 6d 67 20 72 6f 6f 74 3d 50 41 52 54 55 55 49 44 3d 64 37 64 61 33 38 34 35 ... >
NodeOS-mount-filesystems> var cmdline = fs.readFileSync('/proc/cmdline')
undefined
NodeOS-mount-filesystems> cmdline.toString()> 'initrd=\initramfs-linux.img root=PARTUUID=d7da3845-7e88-4930-8ce6-6c4e9d679f07\n'
NodeOS-mount-filesystems>


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#266 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAgfvvqFywxD-RjEnETzYYYG3mx1HB0Eks5qQsQogaJpZM4I_JdV
.

@luii
Copy link
Member Author

luii commented Jun 29, 2016

You wont belive it but im just halfway through with documenting the module just as you spoke of

@piranna
Copy link
Member

piranna commented Jun 29, 2016

Lol! :-P I believe, promise! :-P
El 29/6/2016 21:29, "Philipp Czarnetzki" notifications@github.com
escribió:

You wont belive it but im just halway through with documenting the module
just as you spoke of


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#266 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAgfvsaA_P_5BwJJLGwmVUDxosHOyrnhks5qQseNgaJpZM4I_JdV
.

@luii
Copy link
Member Author

luii commented Jul 2, 2016

@piranna i've restored the deleted dockerfile on userfs and edited the dockerBuild that it is compiling userfs
Then i started the docker nodeos image and looked into the fs and got this

→ npm run docker                                                      [97c8f05]

> NodeOS@1.0.0-RC2 docker /home/philipp/Dokumente/NodeOS
> scripts/docker

mount procfs: Operation not permitted
mount devtmpfs: Operation not permitted
{ Error: EPERM, Operation not permitted 'proc'
    at Error (native) errno: 1, code: 'EPERM', path: 'proc', syscall: 'mount' }
Trace: { Error: EPERM, Operation not permitted 'overlay'
    at Error (native) errno: 1, code: 'EPERM', path: 'overlay', syscall: 'mount' }
    at onerror (/lib/node_modules/nodeos-mount-filesystems/server.js:37:13)
    at done (/lib/node_modules/nodeos-mount-filesystems/server.js:225:5)
    at /lib/node_modules/nodeos-mount-filesystems/node_modules/async/lib/async.js:52:16
    at done (/lib/node_modules/nodeos-mount-filesystems/node_modules/async/lib/async.js:241:17)
    at /lib/node_modules/nodeos-mount-filesystems/node_modules/async/lib/async.js:44:16
    at /lib/node_modules/nodeos-mount-filesystems/server.js:174:24
Starting REPL session
NodeOS-mount-filesystems> var fs = require('fs')
undefined
NodeOS-mount-filesystems> fs.readdirSync('/')
[ '.dockerenv', 'bin', 'dev', 'etc', 'lib', 'proc', 'sys', 'tmp' ]
NodeOS-mount-filesystems> fs.readdirSync('/tmp')
[ '.workdirs', 'latest' ]
NodeOS-mount-filesystems> 

If im correct that nodeos-mount-filesystem invoked overlay_user but why is there a user named latest?
Edit: If i try to read latest with readFileSync i get Memory exceeded because the buffer i get is so big that it eats the RAM of the repl in one bite :D

@piranna
Copy link
Member

piranna commented Jul 2, 2016

If im correct that nodeos-mount-filesystem invoked overlay_user but why is there a user named latest?

Could it be that's the filesystem image itself? I didn't go yet as far as you have gone... :-) Use fs.stat() to see the size of the file and check if it's the usersfs image, if so then you'll need to manage how to mount it, maybe configuring Docker to mount it, or mapping it to /dev/sda or mounting it on the host and using that directory... There are several alternatives, but as I told you, you are going here beyond that me and there will be dragons ;-)

@piranna
Copy link
Member

piranna commented Jul 2, 2016

@luii
Copy link
Member Author

luii commented Jul 2, 2016

@piranna yep its the userfs image as user its around 223mb big and the user itself is around 200mb big

@piranna
Copy link
Member

piranna commented Jul 2, 2016

@piranna yep its the userfs image as user its around 223mb big and the user itself is around 200mb big

Ok, that's good :-) Can you share your Dockerfile and the output of tree out/?

@luii
Copy link
Member Author

luii commented Jul 2, 2016

@piranna i just took the Dockerfile from this commit and updated the dockerBuild script accordingly:

(
  cd node_modules/nodeos-barebones &&
  npm run dockerBuild              || exit 10
) &&
(
  cd node_modules/nodeos-initramfs &&
  npm run dockerBuild              || exit 20
) &&
(
  cd node_modules/nodeos-rootfs    &&
  npm run dockerBuild              || exit 30
) &&
(
  cd node_moudules/nodeos-usersfs &&
  npm run dockerBuild              || exit 35
) &&
(
  docker build -t nodeos .         || exit 40
) || exit $?

@piranna
Copy link
Member

piranna commented Jul 2, 2016

That Dockerfile only copy the filesystem image, what we need is to mount
it, so it's useless. I don't know if this would be feasable by mapping it
to /dev/sda when executing Docker and mounting it from inside NodeOS, or
mounting it from other place (since we have it available), or map the build
directory, or convert it to a Docker volume... There's a lot of
alternatives, and I'm not sure what one would work.
El 2/7/2016 15:04, "Philipp Czarnetzki" notifications@github.com escribió:

@piranna https://github.com/piranna i just took the Dockerfile from
this commit
https://github.com/NodeOS/nodeos-usersfs/blob/98c2356bf4931e48513d8c7c2e20e02028cf9364/Dockerfile
and updated the dockerBuild script accordingly:

(
cd node_modules/nodeos-barebones &&
npm run dockerBuild || exit 10
) &&
(
cd node_modules/nodeos-initramfs &&
npm run dockerBuild || exit 20
) &&
(
cd node_modules/nodeos-rootfs &&
npm run dockerBuild || exit 30
) &&
(
cd node_moudules/nodeos-usersfs &&
npm run dockerBuild || exit 35
) &&
(
docker build -t nodeos . || exit 40
) || exit $?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#266 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AAgfvkmvMFqPJnj7Qxtymz1umVBpMTfuks5qRmG-gaJpZM4I_JdV
.

Like in the other file (dockerBuild) we need to change the name to lowercase. And after this docker complains about absolute paths for this i put a slash infront of the userfs var
@luii
Copy link
Member Author

luii commented Feb 2, 2017

I think we can close this since you got it working on docker

@piranna
Copy link
Member

piranna commented Feb 3, 2017

Docker support is still experimental as you have seen... Also I would like to integrate the publish of releases to Docker Hub before consider it fully finished.

@luii
Copy link
Member Author

luii commented Feb 7, 2017

But the problems described in here are resolved

@luii luii closed this Feb 7, 2017
@piranna
Copy link
Member

piranna commented Feb 7, 2017 via email

@luii
Copy link
Member Author

luii commented Feb 7, 2017

I know that you want to keep track of all the things related to docker and thats totally fine, but my changes in this PR were total trash (e.g. set absolute path for something that needs to be relative, at that time i had brain farts or something idk) and the naming problem of the image was resolved in #265.
BTW im doing some work on the Wiki if you noticed, if there is something thats not correct please feel free to change it ;-)

@piranna
Copy link
Member

piranna commented Feb 8, 2017

the naming problem of the image was resolved in #265

Ah, ok then! That was the only concern I had about this :-)

BTW im doing some work on the Wiki if you noticed, if there is something thats not correct please feel free to change it ;-)

I'll try to take a look, but I'm busy lately, that's why I'm having problems to answer. Anyway, we should decide about what to do with the wiki and the docs repo... I would move them to the docs folder to have it integrated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants