fabric8io / fabric8

fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
http://fabric8.io/
1.76k stars 504 forks source link

Cannot create remote (SSH) containers when offline (1.x) #2016

Open rawlingsj opened 10 years ago

rawlingsj commented 10 years ago

I noticed that when building a snapshot the fabric8-karaf-1.1.0-SNAPSHOT.zip is not available in the system folder. Not sure if it's supposed to be but when creating remote containers the script attempt to download the distro and looks to be trying to get it from the default repos instead (see log below)

Where should it find the zip? I checked the released versions and they appear the same as they have no fabric8-karaf-*.zip in the system folder.

I tried to copy the zip into the ${fuse_install_dir}/system/io/fabric8/fabric8-karaf/1.1.0-SNAPSHOT but still no joy.

Downloading Maven Artifact with groupId: io.fabric8 artifactId: fabric8-karaf and version: 1.1.0-SNAPSHOT from repository: https://repo.fusesource.com/nexus/content/groups/public/
Using URL: https://repo.fusesource.com/nexus/content/groups/public/io/fabric8/fabric8-karaf/1.1.0-SNAPSHOT/fabric8-karaf-1.1.0-SNAPSHOT.zip
Download failed with code: 404
Downloading Maven Artifact with groupId: io.fabric8 artifactId: fabric8-karaf and version: 1.1.0-SNAPSHOT from repository: https://repo.fusesource.com/nexus/content/groups/ea/
Using URL: https://repo.fusesource.com/nexus/content/groups/ea/io/fabric8/fabric8-karaf/1.1.0-SNAPSHOT/fabric8-karaf-1.1.0-SNAPSHOT.zip
Download failed with code: 404
Downloading Maven Artifact with groupId: io.fabric8 artifactId: fabric8-karaf and version: 1.1.0-SNAPSHOT from repository: https://repo.fusesource.com/nexus/content/repositories/snapshots/
Using URL: https://repo.fusesource.com/nexus/content/repositories/snapshots/io/fabric8/fabric8-karaf/1.1.0-SNAPSHOT/fabric8-karaf-1.1.0-SNAPSHOT.zip
Download failed with code: 404
Command Failed:Could not find file fabric8-karaf-1.1.0-SNAPSHOT.zip
keithlynch commented 10 years ago

i had this issue too. You can use the --proxy-uri argument of container-create-ssh to provide your localhost and then run a local http server when in offline mode with a symlink to your local m2 repo

jstrachan commented 10 years ago

good point! I guess this is mostly an issue with snapshot builds; we could do with a flag or something to indicate its a snapshot build so we could copy the zip inside the system folder (or maven proxy folder) or something...

jstrachan commented 10 years ago

only if the zip has to include the zip which includes the zip..... we might use all the worlds disk space ;)

rawlingsj commented 10 years ago

yeah that could get ugly!

the other work around is to create a .m2 folder under the home user you're running fabric8 as, I added the distro under the correct maven coordinates e.g. /home/fuse/.m2/repository/io/fabric8/fabric8-karaf/1.1.0-SNAPSHOT

there seems to be a few more missing snapshot dependencies so I'll just use the new fabric8-karaf-1.1.0.CR3

davsclaus commented 10 years ago

I did work a bit with trying to include more needed JARs out of the box, such as whatever the quickstarts needed as they demonstrate a fair bit of fabric usage, and would allow people to try those in offline mode.

The ticket is here https://github.com/fabric8io/fabric8/issues/2001

This adds about 90mb more of JARs - although I couldn't get it to fully work with a fusesource notice plugin that barfs about some JARs has missing some files :(

But that approach would allow us to ensure that profiles with X would work.

It gets a bit more complicated to ensure X JARs is included in fabric8 as in the old days we needed karaf features for everything and we could use the karaf maven plugin to download the JARs. But as fabric8 now deploys on tomcat et all we need something else too - which is the generic maven dependency plugin, although it has its can of worms, as you can see from that ticket, where I needed to use an ant script to copy the JARs to a single location.

jstrachan commented 10 years ago

yeah; I guess we need to carefully decide what we need to include in a distro. I just submitted a PR to enable things like autoscaler, docker, openshift out of the box.

We maybe need a command to 'install stuff' on demand outside of the core stuff; so when its stuff like quickstarts and MQ stuff; we maybe need an easy way to download and install those on the fly? (rather than having to make lots of distros)

davsclaus commented 10 years ago

Yeah we could have a script in bin, that downloads the needed JARs based on what choices you make.

So you unzip that zip we produce today, and run

bin/download-all

And maybe have more download-xxx scripts. We could make the script call some java code that downloads it, as windows users usually have problems with having wget etc available. That java code could do what the fabric-download-artifacts does today.

jstrachan commented 10 years ago

its maybe a bit like this https://github.com/fabric8io/fabric8/issues/1463

where folks could 'install' all the requirements for a selection of profiles / profile zips to avoid having to do it at runtime? So folks could make their own distros of what they need