HNHacker News
TopNewBestAskShowJobs

crohr

331 karma · joined January 23, 2012

Maker of fine DevOps tooling since 2013.

Currently launching https://runs-on.com, 10x cheaper GitHub Action runner, on premise.

More details at https://cyrilrohr.com

submissionscomments
crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hi Alex,

I think you’re confusing me with the original creators of PullReview. My other venture is packager.io, which you might remember as well. Congrats to you for the continued development of your on premise packaging solution!

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello! The first recommendation would be to find a docker image providing a mock for the service you want (e.g. [1]) and if not enough then you could provision those services on demand in an additional step executing before the pullpreview step in the GitHub Action workflow file.

[1] https://github.com/localstack/localstack

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello, we thought about other providers as well, can you send me an email to discuss (should be in my profile)? Thanks!
crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello, thanks for your comment and the great points you’ve made.

Regarding security, we do believe that it is a selling point for many companies. You might be ok granting access to Circle CI or others, but for a new kid on the block that’s more difficult. And being run as a self contained action means you are not dependent on the availability or continuity of the service you depend on.

As for misbehaving instances, this is indeed something that we thought about, and we’ll make sure this doesn’t happen in two ways: - allowing to set a max duration for an instance, and a max number of concurrent instances - having an additional trigger in the workflow file to launch a cleanup phase like every day, since GitHub actions already support cron-like tasks

I’ll send you an email a bit later as I’m currently on the go, thanks again and talk to you soon!

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
> The bulk of my spin up time is spent pulling the image. I never got around to figuring out how to do a good cache for it.

With our approach you keep the same instance for the duration of a PR or branch, so you mostly incur the docker tax On the first deploy. Afterwards it will reuse the local cache.

Does that make sense?

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
It may be simple for you to do, but you just described having to provision a server, manually checkout your code using SSH agent forwarding or HTTPS auth, setup your environment variables, and then launch the app. And manually repeat the last steps as many times as you push to your branch.

At this point you’re the only one to know about your preview server, and you need to not forget to destroy it when you’re done.

PullPreview handles all of the synchronisation mechanism, as well as providing pretty URLs, automated SSH access to any GutHub users, source IP filtering, port firewalling, HTTPS support etc.

Plus the whole integration into GitHub so that you don’t need to retrieve the preview URL by yourself, and you get notified if anything goes wrong during the deploy, with full logs available.

That’s the gap we’re trying to fill :)

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello, review apps are a hot topic it seems ;)

Many companies have come with their own version of the concept, which in our experience doesn’t stand well the test of time (because the person that wrote the glue code left the company or docs are lacking or setup is very complex, etc). Hence PullPreview, so that companies can delegate the burden of maintaining that workflow to us, while retaining full control over their code and servers.

Our version is also Open Source (but not free except for non profits) and it doesn’t limit in any way the number of ports you can expose . By default and for ease of use ports 22, 80 and 1000-10000 are allowed in the firewall, but you can reduce that to the bare minimum with just a single config option. See https://github.com/pullpreview/action/wiki/Inputs For more details.

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Also, something we didn’t mention on the site but might be interesting for some people: we’re more than happy to provide guidance and consulting on how to migrate your app to Docker Compose if that could be a blocker. Think of it as a kind of Concierge service. Don’t hesitate to send an email if you might be interested.
crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Yep, it’s also not limited to GitHub in any way and could be used straight from your dev machine or from other CI tools such as GitLab CI, Circle, Jenkins, etc.
crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
> Since a new server is launched for every preview, it would be cool if the packaging used cloud-init vs docker-compose.

Actually the way it works now is that you keep the same server for the duration of a PR / branch. This means faster redeploys since the docker cache is there, and you don’t lose your demo data on every redeploy.

Cloud-init is used for the initial setup of docker and compose, but then the code sync happens through sending the app tarball from GitHub to the server and refreshing the compose.

We thought about mono-node k8s, but found that removing one abstraction layer would be better for now.

Thanks for your comment!

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
I didn’t know about FeaturePeek, thanks for mentioning. It looks very similar indeed. From a quick look I would say the main differences are that it doesn’t run on servers you control, and is limited to frontend code only?

Also it’s pretty expensive with their per-seat pricing ;)

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello, thanks for your comment!

I had a look at the angular way of doing it: very nice to see other approaches! From a quick look it does seem to require quite a bit more steps and to be more limited in scope, but the documentation looks very good indeed! Thanks for sharing!

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hi, thanks for commenting!

The idea here is not to skip the code review, but augment it with a way to experiment with the feature as early as possible in the development process.

It’s particularly useful for product owners who may not be coders and want to give feedback on how the feature aligns with the vision.

It’s also useful for other developers because seeing the thing live will give more context as to what the feature does and how it behaves, and as such might help reviewing the code and get reviews other than « good to merge » without any meaningful comments.

And finally it’s also very useful in making sure every dev can do a little QA on their feature in a standardised environment that runs with non-dev setting, without waiting for a staging server to be available.

The 80/20 rule most likely applies here. For some PRs you won’t need preview environments (just don’t add the label), but from my consulting gigs I have experienced more than once the need for this kind of tooling, and also witnessed more than once how many companies try to reinvent their own thing and the time they spend/waste doing so.

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello, and thanks for your comment!

There are indeed a few other solutions to this problem. But we haven’t found any with all of the following characteristics:

a) doesn’t require access to your private code

b) works for any type of app

c) doesn’t require buying into kubernetes if you don’t want to

d) cheap to run

A little digression here but the main trigger for creating this was seeing a post [1] on the Basecamp blog about their implementation of preview envs for their upcoming service: It seemed so convoluted and expensive that surely there was a way to do it with less moving parts (I totally understand that Basecamp may require a complex setup like that, but I’m pretty sure it should remain an outlier).

Your comment about Netlify forgetting to remove the deployment link from the GitHub UI once it’s merged is also true, and from my testing Heroku also forgets to remove it. The GitHub deployment API documentation really needs some love, but still surprising since the removal is supported.

Regarding domain name provisioning, you can see a few examples in the demos linked from the features page. Currently the pattern is IP-gh-REPO_ID-[pr|branch]-[PR_NUMBER|BRANCH_NAME].my.pullpreview.com. Something I forgot to mention on the features page is that custom domain names are also supported. Custom patterns could also be supported without any issue.

[1] https://m.signalvnoise.com/seamless-branch-deploys-with-kube...

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hello, thanks for the kind words, and yes I think GitHub Actions have the potential to replace a large part of the current GitHub SaaS ecosystem.

There are a few demos listed in the Features section. The simplest one being a wordpress repo which shows the absolute minimal configuration required in terms of files (1 docker-compose, and 1 workflow file): https://github.com/pullpreview/demo-wordpress

You can clone that repo and fill in your AWS credentials in the Secrets section of the GitHub repository settings, and then you'll get a live environment running (like in https://github.com/pullpreview/demo-wordpress/deployments)

crohr··on Show HN: PullPreview – Deploy previews for any application, on your servers
Hi HN, this is our submission for PullPreview, a way to spin preview environments for any application directly from GitHub to cheap AWS Lightsail servers. No intermediary service involved.

## Context

PullPreview’s main use case is for making it easier to review code in branches or pull requests, because reviews with live code are always better than code-only reviews. This means better and faster feedback from reviewers (be it clients or teammates), so that everyone can iterate faster on the feature being developed.

However in most organizations, there is only a handful of staging servers available to the developers, which are hard to keep in sync, maintain, and with complicated processes to make sure you don’t step on someone else’s code.

PullPreview solves this with ephemeral environments for any pull request or branches, just by adding a label from the GitHub UI. URLs for the deployed environments are displayed right into the GitHub UI, thanks to the integration with the Deployments API.

## How it works (spoiler: no kubernetes)

Contrary to many other solutions, PullPreview _never sees your code_, because it runs as a GitHub Action and does all the work within the GitHub Action runner. The Action automatically provisions a server in _your_ AWS account (a cheap Lightsail instance), and then boots your application using the Docker Compose file(s) that you specify. The server is automatically destroyed when the PR is merged, closed, or the label removed.

Some of the features include unlimited parallel environments, support for SSH access, source IP filtering, port filtering, seed data support, data persistence across deploys, all managed from the GitHub UI.

All of this is packaged as an Open-Source GitHub Action that can be tried right now. You can run it for free for 30 days, and after that we have two license tiers at 120€/year and 300€/year. We believe it is pretty cheap compared to rolling and maintaining your own solution in-house. It is also free for non-profits.

## Next steps

We’re looking for feedback on the idea, what could be missing, and the pricing. We are also discovering many more use cases while dogfooding our own idea. For instance, we are currently running a few services in production, continuously deployed thanks to PullPreview (e.g. pullpreview.com itself).

crohr··on Serverless CI/CD on the AWS Cloud
GitHub Actions are pretty powerful actually. I wrote https://github.com/pullpreview/action, which allows to continuously deploy branches and PRs to AWS instances and it works great.

The trick is to understand that for complex behaviours you can't just glue different actions together, and instead you may have to build your own action and use the GitHub API token provided in the context to possibly perform additional actions.

crohr··on Replacing Disqus with GitHub Comments
If you're interested in this approach, I wrote about using GitHub issues as the basis for your blog, and not just comments - http://ebarnouflant.com/posts/4-turn-your-github-issues-into...
crohr··on Ruby 2.1.5 Released
For anyone interested, DEB and RPM packages are available at https://packager.io/gh/pkgr/rubies for various distributions. For instance for ubuntu 14.04: https://packager.io/gh/pkgr/rubies/install?bid=28#ubuntu-14-...
crohr··on Packager – Announcing RPM support for Ruby and NodeJS projects
Glad you remember it ;) I figured it would be an easier name to remember (and use in writing).
crohr··on Why I made pkgr.io – digressions on software packaging
OP here. It's true that Heroku were required to pre-install a lot of dependencies, because they don't offer a way for developers to specify additional dependencies to be installed on their servers.

On the contrary, with pkgr.io, additional build and runtime dependencies can/must be added by the package maintainer if anything other than the base stuff is needed. See https://pkgr.io/doc#dependencies and, as an example, the .pkgr.yml file for a fairly complex project such as Gitlab: https://github.com/pkgr/gitlabhq/blob/pkgr/.pkgr.yml.

crohr··on Pkgr.io: Easy way to get a Debian package out of any app
No, the hooks currently supported are scripts that are run before and after the slug compilation phase. I don't think you would want to make your package installation dependent on pre/post install scripts that access the network.
crohr··on Pkgr.io: Easy way to get a Debian package out of any app
OP here. Totally right, the final goal being that a new version of the package gets automatically rebuilt whenever a buildpack gets updated with a security fix.
crohr··on Pkgr.io: Easy way to get a Debian package out of any app
You have the possibility to add custom before/after hooks, and thus upload freshly precompiled assets from them, however there is currently no secure way to encrypt secrets (in your case, S3 credentials). This may come later on (a la Travis-CI, http://docs.travis-ci.com/user/encryption-keys/), but is not a priority right now.
crohr··on Pkgr.io: Easy way to get a Debian package out of any app
OP here, thanks for the comment. fpm is a great tool: PKGR is based on https://github.com/crohr/pkgr, which itself uses fpm. That being said, you indeed need to make sure your build system is close to your target system, and it is not that easy to package complex apps with specific dependencies. Generally, (Web) Application packaging does not have the same needs as OS packaging.
crohr··on Pkgr.io: Easy way to get a Debian package out of any app
OP here. For all the goodness offered by Docker to deploy apps, sometimes a good old debian package is all that's needed. The format is widely supported and battle-tested, while Docker requires specificities under the form of kernel version, additional software to install, and additional operational knowledge.

In short, if you already have a working Docker installation, you probably don't need PKGR, though nothing prevents you from building your containers by simply apt-get install'ing the app instead of having 10's of RUN commands to install the dependencies.

crohr··on Pkgr.io: Easy way to get a Debian package out of any app
At launch, only Ruby and Node.js projects are officially supported. But you can always specify another buildpack in your app's configuration to test with other runtimes (https://pkgr.io/doc#buildpack).
crohr··on ShowHN: GetURL - A CLI tool to get a public link for any file
In the same vein, you can try http://flag.io/:

  curl -T /path/to/any/file flag.io
  # or
  cat some-file | curl -T - flag.io
Basically, pipe anything you want into it. It can also syntax-highlight your text files.
← PreviousPage 3 of 3