about summary refs log tree commit diff
path: root/tools/nixery/server/main.go
AgeCommit message (Collapse)AuthorFilesLines
2019-10-28 fix(server): Thread request context to all relevant placesVincent Ambo1-5/+1
Previously background contexts where created where necessary (e.g. in GCS interactions). Should I begin to use request timeouts or other context-dependent things in the future, it's useful to have the actual HTTP request context around. This threads the request context through the application to all places that need it.
2019-10-28 feat(server): Add filesystem storage backend config optionsVincent Ambo1-0/+2
The filesystem storage backend can be enabled by setting `NIXERY_STORAGE_BACKEND` to `filesystem` and `STORAGE_PATH` to a disk location from which Nixery can serve files.
2019-10-28 refactor(server): Pass HTTP request to storage.ServeLayerVincent Ambo1-1/+1
The request object is required for some serving methods (e.g. the filesystem one).
2019-10-28 refactor(server): Change setup to create new storage backendsVincent Ambo1-3/+17
2019-10-28 refactor(server): Introduce pluggable interface for storage backendsVincent Ambo1-57/+9
This abstracts over the functionality of Google Cloud Storage and other potential underlying storage backends to make it possible to replace these in Nixery. The GCS backend is not yet reimplemented.
2019-10-06 refactor(server): Use logrus convenience functions for logsVincent Ambo1-32/+12
Makes use of the `.WithError` and `.WithField` convenience functions in logrus to simplify log statement construction. This has the added benefit of making it easier to correctly log errors.
2019-10-06 refactor(server): Convert existing log entries to structured formatVincent Ambo1-11/+49
This rewrites all existing log statements into the structured logrus format. For consistency, all errors are always logged separately from the primary message in a field called `error`. Only the "info", "error" and "warn" severities are used.
2019-10-06 feat(server): Add log level to severity mappingVincent Ambo1-1/+4
The output format now writes a `severity` field that follows that format that should be recognised by Stackdriver Logging.
2019-10-06 feat(server): Use hash of Nixery source as versionVincent Ambo1-1/+5
Uses a hash of Nixery's sources as the version displayed when Nixery launches or logs an error. This makes it possible to distinguish between errors logged from different versions. The source hashes should be reproducible between different checkouts of the same source tree.
2019-10-06 fix(server): Amend package path for Go tooling compatibilityVincent Ambo1-3/+3
With these changes it is possible to keep Nixery in $GOPATH and build the server in there, while still having things work correctly via Nix.
2019-10-06 refactor(server): Replace log calls with logrusVincent Ambo1-1/+1
This introduces a structured logging library that can be used (next step) to attach additional metadata to log entries.
2019-10-03 feat(server): Fetch popularity data on launchVincent Ambo1-0/+37
The last missing puzzle piece for #50!
2019-10-03 feat(server): Reimplement local manifest cache backed by filesVincent Ambo1-2/+11
Implements a local manifest cache that uses the temporary directory to cache manifest builds. This is necessary due to the size of manifests: Keeping them entirely in-memory would quickly balloon the memory usage of Nixery, unless some mechanism for cache eviction is implemented.
2019-10-03 refactor(server): Clean up cache implementationVincent Ambo1-4/+4
A couple of minor fixes and improvements to the cache implementation.
2019-10-03 fix(server): Minor fixes to updated new builder codeVincent Ambo1-2/+2
2019-10-03 refactor(server): Introduce a state type to carry runtime stateVincent Ambo1-11/+7
The state type contains things such as the bucket handle and Nixery's configuration which need to be passed around in the builder. This is only added for convenience.
2019-09-10 feat(server): Cache built manifests to the GCS bucketVincent Ambo1-1/+1
Caches manifests under `manifests/$cacheKey` in the GCS bucket and introduces two-tiered retrieval of manifests from the caches (local first, bucket second). There is some cleanup to be done in this code, but the initial version works.
2019-09-10 refactor(server): Move package source management logic to serverVincent Ambo1-1/+5
Introduces three new types representing each of the possible package sources and moves the logic for specifying the package source to the server. Concrete changes: * Determining whether a specified git reference is a commit vs. a branch/tag is now done in the server, and is done more precisely by using a regular expression. * Package sources now have a new `CacheKey` function which can be used to retrieve a key under which a build manifest can be cached *if* the package source is not a moving target (i.e. a full git commit hash of either nixpkgs or a private repository). This function is not yet used. * Users *must* now specify a package source, Nixery no longer defaults to anything and will fail to launch if no source is configured.
2019-08-14 fix(server): Print correct project name during startupVincent Ambo1-1/+1
They grow up so fast :')
2019-08-14 feat(builder): Implement build cache for manifests & layersVincent Ambo1-1/+4
Implements a cache that keeps track of: a) Manifests that have already been built (for up to 6 hours) b) Layers that have already been seen (and uploaded to GCS) This significantly speeds up response times for images that are full or partial matches with previous images served by an instance.
2019-08-14 refactor(server): Extract build logic into separate moduleVincent Ambo1-304/+26
This module is going to get more complex as the implementation of #32 progresses.
2019-08-14 refactor(server): Use wrapper script to avoid path dependencyVincent Ambo1-6/+2
Instead of requiring the server component to be made aware of the location of the Nix builder via environment variables, this commit introduces a wrapper script for the builder that can simply exist on the builders $PATH. This is one step towards a slightly nicer out-of-the-box experience when using `nix-build -A nixery-bin`.
2019-08-14 refactor: Move registry server to a subfolderVincent Ambo1-0/+492