-
Notifications
You must be signed in to change notification settings - Fork 1
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
overview issue for proof-of-concept #1
Comments
Oh and here are two things that I don't think are necessary for an initial release, but it would be nicer to have them:
|
The timeout issue looks to belong to the server part. |
@kayhide Yeah, I think you're right. @kayhide @jonascarpay Also, please feel free to directly edit the comments in this issue to clean things up or better separate tasks! I imagine we might want to eventually split out each of these bullet points to separate issues when we really start working on each one. |
Do you know if it's possible to easily distinguish a curl query vs a browser query? I'd like it if accessing binplz.dev/foo with a browser could give you some information, maybe the build log, and a download link, but with curl it would download the binary. Although maybe there's a better way to go about this. Also, I want to get some experience with IaC, do any of you have experience with this? |
I was actually thinking the exact same thing! I think this would be a really neat feature. Although I imagine we should probably only work on this after the initial release, since I could see this potentially being a lot of work. In order to determine whether the user is accessing through $ curl --verbose google.com
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.81.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 301 Moved Permanently
< Location: http://www.google.com/
... It's the
We're currently using Terraform at work, and it is pretty nice. I was going to suggest we do deployments to AWS (including the ec2 instances or docker containers, dynamo db creation, route53 registration(?), s3 bucket creation, cloudflare cdn setup(?)) with something like Terraform. |
I am kind of against this idea. Changing responses depending on a user-agent is often more confusing than beneficial. Or have you had any good experience of user-agent switching behavior? Rather than that, I would suggest different urls for the browser versions like
I have experience of serverless and kubernetes, and I don't think either of them fits our case (at least for the beginning). |
Here's what we talked about during our meeting today:
|
I wanted to do a small write-up on what I think we'll need for an initial proof-of-concept release. Hopefully with this list it will be easier for us to have a conversation about how to split up the work.
A web api. We'll need a web api that can accept http requests like
binplz.dev/stack
, and know how to parse out that the user actually wants thestack
binary.I'm imagining doing this as a Haskell servant API, but I imagine our API will be simple enough that it doesn't really matter what we use.
In the future I'd also like to support additional url parameters like the following:
binplz.dev/stack.tar.gz
for downloading a whole package (instead of just a single binary), or potentially a whole closure. Also URL parameters like the following:binplz.dev/procps?arch=aarch64-linux&binary=ps&nixpkgs_commit=abcde1234&linking=dynamic
. We definitely don't need to support these types of things in our initial proof-of-concept release, but we should at least try to to implement our proof-of-concept in a way that doesn't makes it impossible to implement these types of additional features.Another worry I have here is whether or not we have to worry about http timeouts. Building a binary could potentially takes tens of minutes, and I'm worried that
curl
will timeout.edit: completed in Server #6
Determine package from bin name
We also need to decide whether we'd like the path (like
stack
orprocps
in the example above) to refer to a Nixpkgs top-level attribute name, or an actual binary. Having it refer to an actual binary would be easier for end-users, but significantly harder for us. For instance, even for theps
binary, there are a bunch of packages to that provide it:We don't really have a good way to know that
ps
should come fromprocps
.A function to take a Nixpkgs top-level attribute (like
stack
,xterm
,haskellPackages.weeder
, etc), fork off anix-build
process, monitor thenix-build
process, and return either a binary whennix-build
is finished, or an error.I think this is relatively straight-forward, except that we want to make sure the user can't build some arbitrary Nix code that includes the output of
buitins.readFile /etc/shadow
or something weird. I think there are nix-build options you can pass to disable these types of built-ins, but we'd need to research it.We also likely want to cache negative build results. We'd ideally like to cache negative build results per derivation, but I don't know how easy that would be.
We probably also want to make sure that we run builds until they finish (so that the derivation output is cached), even if a user presses Ctrl-C on
curl
and disconnects from the api.Some sort of static documentation website / landing-page. I'm imagining that accessing the top-level
binplz.dev/
will redirect todocs.binplz.dev
, and we can host the docs on github or something. I think https://nixery.dev/ is really nice, and we should basically just copy what they do.Deployment notes #3
The text was updated successfully, but these errors were encountered: