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

Walkthrough doesn't work #188

Open
baryluk opened this issue Mar 7, 2021 · 1 comment
Open

Walkthrough doesn't work #188

baryluk opened this issue Mar 7, 2021 · 1 comment

Comments

@baryluk
Copy link

baryluk commented Mar 7, 2021

I was following https://github.com/cloudius-systems/capstan/blob/master/Documentation/WalkthroughNodeJS.md

$ ~/bin/capstan -v
capstan version v0.5.0
$
user@debian:~/word-finder$ ~/bin/capstan package compose com.example.word-finder
Command line will be set based on config_set_default attribute of meta/run.yaml
Resolved runtime into: node
Prepending 'node' runtime dependencies to dep list: [node-4.4.5]
Package node-4.4.5 does not exist in your local repository. Pull it manually using 'capstan package pull node-4.4.5' or enable automatic pulling of missing packages by adding --pull-missing flag
user@debian:~/word-finder$

Adding --pull-missing (which should be added to the walkthrough actually) or manually pulling doesn't work:

user@debian:~/word-finder$ ~/bin/capstan package pull node-4.4.5
package node-4.4.5 is not available in the given release (any) in GitHub
user@debian:~/word-finder$
@wkozaczuk
Copy link
Collaborator

Hi. Unfortunately, the capstan documentation is awfully outdated or non in sync with reality at this point in time. Unfortunately, the walkthrough doc assumes older S3 packages repo that is no longer maintained. At this moment some of the latest packages are published under OSv github repo (see "Assets" under particular release - https://github.com/cloudius-systems/osv/releases). The capstan has been enhanced since to work with github repo.

In any case, the latest way to quickly build a Node.JS image and run it on OSv is this (in some empty dir):

capstan package compose --pull-missing --require osv.node-js node-example
Command line will be set to default boot
Manifest file /tmp/node-example/meta/package.yaml does not exist. Assuming default manifest
Downloading osv.node-js.yaml... from https://github.com/cloudius-systems/osv/releases/download/v0.51.0/osv.node-js.yaml
103 B / 103 B [--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% ? p/s
Downloading osv.node-js.mpm... from https://github.com/cloudius-systems/osv/releases/download/v0.51.0/osv.node-js.mpm
10.06 MiB / 10.06 MiB [-----------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 2.04 MiB p/s
extractPackageContent: osv.bootstrap
extractPackageContent: osv.node-js
Importing node-example...
Importing into /home/wkozaczuk/.capstan/repository/node-example/node-example.qemu
Uploading files to /home/wkozaczuk/.capstan/repository/node-example/node-example.qemu...
Setting cmdline: --norandom --nomount --noinit /tools/mkfs.so; /tools/cpiod.so --prefix /zfs/zfs; /zfs.so set compression=off osv
Uploading files  <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------> ? p/s 100.00%
Command line set to: 'runscript /run/default;'
[wkozaczuk@fedora-mbpro node-example]$ capstan run -p qemu -v --execute '/libnode.so' node-example
Removing orphaned instance folder: /home/wkozaczuk/.capstan/instances/qemu/python2-test
Command line will be set based on --run parameter
Created instance: node-example
Setting cmdline: /libnode.so
Invoking QEMU at: /usr/bin/qemu-system-x86_64 with arguments:
  -vnc :1
  -m 1024
  -smp 2
  -device virtio-blk-pci,id=blk0,bootindex=0,drive=hd0
  -drive file=/home/wkozaczuk/.capstan/instances/qemu/node-example/disk.qcow2,if=none,id=hd0,aio=threads,cache=none
  -chardev stdio,mux=on,id=stdio,signal=off
  -device isa-serial,chardev=stdio
  -netdev user,id=un0,net=192.168.122.0/24,host=192.168.122.1
  -device virtio-net-pci,netdev=un0
  -chardev socket,id=charmonitor,path=/home/wkozaczuk/.capstan/instances/qemu/node-example/osv.monitor,server,nowait
  -mon chardev=charmonitor,id=monitor,mode=control
  -enable-kvm
  -cpu host,+x2apic
OSv v0.55.0-121-g3e898f4d
eth0: 192.168.122.15
Booted up in 319.60 ms
Cmdline: /libnode.so
> console.log("Test from OSv!");
Test from OSv!
undefined
> 

This is probably most-up-to-date Wiki -
https://github.com/cloudius-systems/capstan/blob/master/Documentation/ApplicationManagement.md - that documents the 'package' mode of creating OSv images.
Also, you can create your own capstan packages locally from files on the host. Some relevant information can be found here - https://github.com/cloudius-systems/osv/wiki/Running-unmodified-Linux-executables-on-OSv and there - https://github.com/cloudius-systems/osv/wiki/Automated-Testing-Framework.

As you can see we are in desperate need to improve our docs. Any help would be appreciated!

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

No branches or pull requests

2 participants