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

How to install/use godel behind a firewall #600

Open
tbayne opened this issue Sep 21, 2021 · 1 comment
Open

How to install/use godel behind a firewall #600

tbayne opened this issue Sep 21, 2021 · 1 comment

Comments

@tbayne
Copy link

tbayne commented Sep 21, 2021

What happened?

Downloaded a release package godel-2.40.0.tgz.
Untarred the package into godel-2.40.0
Tried to understand "how" to install godel. Tried running godelw which immediately tried to download the package again. Which never completed (waited 10 minutes) likely stalled because I am behind a very restrictive firewall.

What did you want to happen?

Install and use godel v2.40.0

@nmiyake
Copy link
Contributor

nmiyake commented Sep 24, 2021

Thanks for filing this issue. I checked and the documentation for this on the project Wiki is not fully complete. I would like to update that documentation to address the offline case, but in the meantime want to reply to this issue to provide guidance.

The bottom line is that, in order to run godel, the correct godel distribution and plugins/assets for the platform all need to be in the ~/.godel/ directory. Typically these are all downloaded as needed, but if you are offline or unable to connect to download then that is an issue.

If possible, the easiest workaround would be to run godel in an environment/on a machine that can access the resolvers (provided that this machine uses the same OS/Architecture as the final machine) so that all of the required files are downloaded to ~/.godel and then copy the ~/.godel directory to the destination machine.

If that's not possible, here are the instructions for doing this manually -- the steps themselves aren't hard, but there are 10-20 total plugins/assets that would likely need to be downloaded manually:

  1. Ensure that the expanded version of the godel distribution exists in ~/.godel/dists.

You can use the following commands to do this (if there are firewall issues, replace the "download" step with manually obtaining the TGZ instead):

> export GODEL_VERSION=2.40.0
> mkdir -p download
# If firewall rules prevent this, download manually via web browser or obtain TGZ in some other manner
> curl -L "https://github.com/palantir/godel/releases/download/v${GODEL_VERSION}/godel-${GODEL_VERSION}.tgz" -o download/godel-"${GODEL_VERSION}".tgz
> tar -xf download/godel-"${GODEL_VERSION}".tgz -C download
> mkdir -p ~/.godel/dists
> mv download/godel-"${GODEL_VERSION}" ~/.godel/dists/

At this point, if you run ./godelw version it should run godel without trying to download it again.

However, at this point godel will attempt to resolve its plugins and assets, and since these are also done over the Internet you're likely to run into errors like the following:

Error: failed to resolve 6 plugin(s):
    failed to resolve artifact com.palantir.distgo:dist-plugin:1.29.0 using resolvers:
    failed to resolve artifact at https://github.com/palantir/distgo/releases/download/v1.29.0/dist-plugin-1.29.0-linux-amd64.tgz: get call for URL https://github.com/palantir/distgo/releases/download/v1.29.0/dist-plugin-1.29.0-linux-amd64.tgz failed: Get "https://github.com/palantir/distgo/releases/download/v1.29.0/dist-plugin-1.29.0-linux-amd64.tgz": 
...
  1. Ensure that all of the plugins/assets exist where they need to be

The easiest way to do this is probably the following:

  • Manually download all of the required TGZs (as reported by failed resolvers) and put them in a folder (for example,download)
  • Add the following to the godel/config/godel.yml file:
default-tasks:
  resolvers:
    - ./download/{{Product}}-{{Version}}-{{OS}}-{{Arch}}.tgz

This will make it such that the godel resolver will resolve locally. For example, after I did this in a local environment with no network access for the first plugin, running ./godelw version produced:

root@2d91e316a493:~# ./godelw version
Getting package from downloads/dist-plugin-1.28.0-linux-amd64.tgz...
7.15 MiB / 7.15 MiB [------------------------------------------------------------------------------------] 100.00% ? p/s
Error: failed to resolve 5 plugin(s):
    failed to resolve artifact com.palantir.godel-format-plugin:format-plugin:1.7.0 using resolvers:
...

Writing this out does make it clear that this process (fully boot-strapping a given version including all plugins/assets in an offline environment) is more difficult than it could be -- I'll give some thought as to whether there's a low-cost way to improve this (even just including a one-liner to download all necessary TGZ files would be something that would make this much easier but doesn't currently exist).

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