mikelangelo-project / capstan

Capstan, a tool for packaging and running your application on OSv.
http://osv.io/capstan/
Other
19 stars 7 forks source link

unable to replicate the RuntimeJava example #88

Closed redblade closed 6 years ago

redblade commented 6 years ago

Hi, I am trying to replicate the RuntimeJava and I get this error: Prepending 'java' runtime dependencies to dep list: [eu.mikelangelo-project.osv.java] package eu.mikelangelo-project.osv.java is not available in the given repository (https://mikelangelo-capstan.s3.amazonaws.com/)

From the user manual, I also tried to add this require:

I looks like the java runtime is actually not available on the remote repository, is it an error or should I change some settings?

Thanks

miha-plesko commented 6 years ago

Looks like you're using some ancient version of Capstan. Please either compile latest master or download it from here. We're about to release new version tomorrow, sorry about that.

/cc @gberginc

gberginc commented 6 years ago

Let me know @miha-plesko, once you make a new tag and we will make a new release.

redblade commented 6 years ago

I compiled the latest release from master, now the java runtime searches the "openjdk8-zulu-compact1" dependency (and I guess it's ok). Unfortunately I now have another error about a missing file in the local repo, "osv-loader.qemu". Actually in the local repo there is osv-loader.vbox.gz (I am on a MacOS) but its empty. So I re run "capstan pull mike/osv-loader" and found a possible cause, as it returns "gzip: invalid header" error while downloading osv-loader.vbox.gz. I also reinstalled qemu and but there is still the same error. Any suggestions?

BTW, thanks again :)

miha-plesko commented 6 years ago

Hi @redblade, yes, the Java package is now openjdk8-zulu-compact1 by default (also openjdk8-zulu-compact3-with-java-beans is in the repo, but compact1 is default). You should be getting something like this in your console:

$ capstan pull mike/osv-loader
Downloading mike/osv-loader/index.yaml...
 112 B / 112 B [====================================================] 100.00% 0s
Downloading mike/osv-loader/osv-loader.qemu.gz...
 5.23 MiB / 5.23 MiB [==============================================] 100.00% 2s

Are you trying to pull this image from your custom repository or from our "official" one?

$ capstan config print
--- global configuration
CAPSTAN_ROOT: /home/miha/.capstan
CAPSTAN_REPO_URL: https://mikelangelo-capstan.s3.amazonaws.com/  # <-------- repo url
CAPSTAN_DISABLE_KVM: false
CAPSTAN_QEMU_AIO_TYPE: native

It should work with the official repo, I've tested 20 seconds ago 😄 Also, I'm surprised to see that you say you have osv-loader.vbox.gz in your repository, since Capstan is currently only able to work with QEMU.

miha-plesko commented 6 years ago

Oh, in case you're using your own repository already - please make sure that you set enough permissions to the files that are there. I think Capstan is sensitive about that.

redblade commented 6 years ago

I have tried the RuntimeJava example on a clean Ubuntu VM and it's working, the problem that I am experiencing on my Mac doen not allow me to go on with the test. I am using the official repository, these are my commands:

macfranz:test_mike_1 francesco$ capstan config print
--- global configuration
CAPSTAN_ROOT: /Users/francesco/.capstan
CAPSTAN_REPO_URL: https://mikelangelo-capstan.s3.amazonaws.com/
CAPSTAN_DISABLE_KVM: false
CAPSTAN_QEMU_AIO_TYPE: threads
...

macfranz:test_mike_1 francesco$ capstan pull mike/osv-loader
Downloading mike/osv-loader/index.yaml...
 112 B / 112 B [====== ... =======] 100.00% 0s
Downloading mike/osv-loader/osv-loader.vbox.gz...
 0 B / ? [----------- ... -----------=]   0.00%gzip: invalid header
redblade commented 6 years ago

Ok, I found the problem. It looks like Mac OSX comes with the default hypervisor set to vbox.

On Mac OSX it works forcing qemu, so just pulling the qemu osx-loader with the -p flag capstan pull mike/osv-loader -p qemu and running the artefact with the same flag capstan run demo --boot hello -p qemu , otherwise it will produce a "no such image" error