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

datasette publish hyper #59

Closed
simonw opened this issue Nov 11, 2017 · 4 comments
Closed

datasette publish hyper #59

simonw opened this issue Nov 11, 2017 · 4 comments

Comments

@simonw
Copy link
Owner

simonw commented Nov 11, 2017

This is a bit tricky, because unlike Now there doesn't seem to be a way to tell Hyper to "build this Dockerfile and deploy the resulting image". They expect you to build a container and publish it to a registry instead.

https://docs.hyper.sh/Reference/CLI/load.html allows you to publish an image directly from a tarball, but that still leaves the challenge of creating that image. The nice thing about the Now integration is that you don't need to have Docker installed on your local machine.

@simonw
Copy link
Owner Author

simonw commented Nov 11, 2017

See also #14

@simonw simonw added this to the v1 stretch goals milestone Nov 13, 2017
@simonw
Copy link
Owner Author

simonw commented Nov 13, 2017

The datasette package command introduced in 4143e3b is relevant here.

@simonw
Copy link
Owner Author

simonw commented Nov 14, 2017

I managed to do this manually:

datasette package ~/parlgov-db/parlgov.db --metadata=parlgov.json
# Output 8758ec31dda3 as the new image ID
docker save 8758ec31dda3 > /tmp/my-image
# I could have just piped this straight to hyper
cat /tmp/my-image | hyper load
# Now start the container running in hyper
hyper run -d -p 80:8001 --name parlgov 8758ec31dda3
# We need to assign an IP address so we can see it
hyper fip allocate 1
# Outputs 199.245.58.78
hyper fip attach 199.245.58.78 parlgov

At this point, visiting the IP address in a browser showed the parlgov UI.

To clean up...

hyper hyper fip detach parlgov
hyper fip release 199.245.58.78
hyper stop parlgov
hyper rm parlgov

@simonw simonw modified the milestones: v1 stretch goals, v2: visualization edition Nov 14, 2017
@simonw simonw changed the title Ability to publish to a container running on hyper datasette publish hyper Nov 15, 2017
@simonw simonw added the feature label Jul 10, 2018
@simonw simonw removed this from the Visualization edition milestone Jul 10, 2018
simonw added a commit that referenced this issue Jul 26, 2018
This change introduces a new plugin hook, publish_subcommand, which can be
used to implement new subcommands for the "datasette publish" command family.

I've used this new hook to refactor out the "publish now" and "publish heroku"
implementations into separate modules. I've also added unit tests for these
two publishers, mocking the subprocess.call and subprocess.check_output
functions.

As part of this, I introduced a mechanism for loading default plugins. These
are defined in the new "default_plugins" list inside datasette/app.py

Closes #217 (Plugin support for datasette publish)
Closes #348 (Unit tests for "datasette publish")
Refs #14, #59, #102, #103, #146, #236, #347
simonw pushed a commit that referenced this issue Jul 26, 2018
… heroku/now (#349)

This change introduces a new plugin hook, publish_subcommand, which can be
used to implement new subcommands for the "datasette publish" command family.

I've used this new hook to refactor out the "publish now" and "publish heroku"
implementations into separate modules. I've also added unit tests for these
two publishers, mocking the subprocess.call and subprocess.check_output
functions.

As part of this, I introduced a mechanism for loading default plugins. These
are defined in the new "default_plugins" list inside datasette/app.py

Closes #217 (Plugin support for datasette publish)
Closes #348 (Unit tests for "datasette publish")
Refs #14, #59, #102, #103, #146, #236, #347
@simonw
Copy link
Owner Author

simonw commented May 13, 2019

Hyper shut down at the start of this year: https://news.ycombinator.com/item?id=18734658

@simonw simonw closed this as completed May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant