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

Unpack agent release #12

Merged
merged 1 commit into from
Apr 12, 2022
Merged

Unpack agent release #12

merged 1 commit into from
Apr 12, 2022

Conversation

euank
Copy link
Contributor

@euank euank commented Apr 12, 2022

The previous release code produced a 'release.json' that contained raw
binaries rather than zip archives containing the agent.

Changing those binaries to zip archives doesn't exactly work, leading to
errors like:

exec: ngrok: Exec format error

This adds an unpack phase to give us the appropriate format.

Now, a natural question to ask is "why not use fetchTarball instead of
fetchurl, it unzips files for you?"

The answer to that is that our release.json is generated with the sha of
the zip file, but fetchTarball needs the unpacked sha of the directory
tree (nix-prefetch-url --unpack).

Internally, we can derive that, but it's currently easier to use the
sha of the artifact we download directly, partly because other release
mechanisms (brew, etc) expect the zip's sha too.

I also don't think there's any significant difference between the two
options.

We'll have to re-run the release job to actually pick up this change,
but this should let it build and push correct docker images.

The previous release code produced a 'release.json' that contained raw
binaries rather than zip archives containing the agent.

Changing those binaries to zip archives doesn't exactly work, leading to
errors like:

```
exec: ngrok: Exec format error
```

This adds an unpack phase to give us the appropriate format.

Now, a natural question to ask is "why not use fetchTarball instead of
fetchurl, it unzips files for you?"

The answer to that is that our release.json is generated with the sha of
the zip file, but fetchTarball needs the unpacked sha of the directory
tree (nix-prefetch-url --unpack).

Internally, we _can_ derive that, but it's currently easier to use the
sha of the artifact we download directly, partly because other release
mechanisms (brew, etc) expect the zip's sha too.

I also don't think there's any significant difference between the two
options.

We'll have to re-run the release job to actually pick up this change,
but this should let it build and push correct docker images.
Copy link

@russorat russorat left a comment

Choose a reason for hiding this comment

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

lgtm

@euank euank merged commit 09a8f21 into ngrok:main Apr 12, 2022
@euank euank deleted the unzip-ngrok branch April 12, 2022 06:50
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

Successfully merging this pull request may close these issues.

None yet

2 participants