Skip to content

Commit

Permalink
add license, contributing.md, and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
coffee-cup committed Apr 5, 2022
1 parent fa1840f commit 6140b53
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 29 deletions.
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Contributing

Thanks for your interest in contributing to this project! PRs and issues are welcome, but please keep in mind that this project is still and alpha and the the implementation details and API will most likely change between now and a stable release.

For larger changes, please first make an [RFC issue](https://github.com/railwayapp/nixpacks/issues). You can follow along with the roadmap in the [GitHub project](https://github.com/railwayapp/nixpacks/projects/1).

## How to contribute

First, make sure you can build and run the project

1. Ensure you have [Rust](https://www.rust-lang.org/tools/install) and [Docker](https://docs.docker.com/get-docker/) installed.
1. Checkout this repo `git clone https://github.com/railwayapp/nixpacks.git`
1. Build the source `cargo build`
1. Run the tests `cargo test`
1. Build an example `cargo run -- build examples/node --name node`
1. Run the example `docker run node`

You should see `Hello from Node` printed to the console.

## Contribution Ideas

The easiest way to contribute is to add support for new languages. There is a list of languages we would like to add [here](https://github.com/railwayapp/nixpacks/issues?q=is%3Aissue+is%3Aopen+label%3A%22new+provider%22), but languages not on the list are welcome as well. To guage interest you can always create an issue before working on an implementation.

## Making PRs

To make a PR follow [GitHubs guide](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).

PRs are all checked with

- `cargo check`
- `cargo test`
- `cargo clippy`

so you can run these locally to ensure CI passes.

Most PRs should include tests.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Railway Corp.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
61 changes: 32 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@

**App source + Nix packages + Docker = Image**

The goal of this project is to build an app source directory in a reproducible way. Providers analyze the source code and recommend nix packages and suggest install/build/start commands. However, all of these settings can be overriden by the user.
Nixpacks takes a source directory and produces an OCI compliant image that can be deployed anywhere. The project was started by the [Railway](https://railway.app) team as an alternative to [Buildpacks](https://buildpacks.io/) and attempts to address a lot of the shortcomings and issues that occurred when deploying thousands of user apps to the Railway platform. The biggest change is that system level and language dependencies are pulled from the Nix ecosystem, which provides a bunch of benifits.

Nixpacks currently supports
You can follow along with the roadmap in the [GitHub project](https://github.com/railwayapp/nixpacks/projects/1).

- Node/NPM
- Yarn
- Go
- Rust
## Core Ideas

More languages will be added very soon
-**Intutive defaults**: In most cases, building and deploying and app with nixpacks should _just work_ with no configuration needed.
- ⚙️ **Customization where necessary**: Everypart of the pipeline should be customizable. These include the [Nix packages](https://search.nixos.org/packages) to add to the environment and build/start commands.
- 🚀 **Easily extendible**: New providers (langauges) should be able to be easily added to nixpacks with minimal knowledge of Nix and Docker.

## Getting Started
## How Nix is used

_Note: This is a young project and is in active development_
Nix packages are used for OS and language level dependencies (e.g. [nodejs](https://search.nixos.org/packages?channel=unstable&show=nodejs&from=0&size=50&sort=relevance&type=packages&query=nodejs) and [ffmpeg](https://search.nixos.org/packages?channel=unstable&show=ffmpeg&from=0&size=50&sort=relevance&type=packages&query=ffmpeg)). These packages are built and loaded into the environment where we then use these dependencies to install, build, and run the app (e.g. `npm install`, `cargo build`, etc.).

## How Docker is used

At the moment nixpacks generates a `Dockerfile` based on all information available. To create an image this is then built with `docker build`. However, this may change so providers should not need to know about the underlying Docker implementation.

# Docs

This project is not yet distributed anywhere and must be built with [Rust](https://www.rust-lang.org/tools/install).

Expand Down Expand Up @@ -49,10 +54,8 @@ cargo run -- build $APP_SRC --name $NAME

![image](https://user-images.githubusercontent.com/3044853/161355162-73651b6d-6ee2-41ee-a0f0-abbf581ce8f4.png)


View the help with `cargo run -- build --help`


## How this works

Nixpacks works in two phases
Expand All @@ -75,21 +78,21 @@ The build phase takes the build plan and creates an OCI compliant image (with Do

Overall the process is fairy simple.

## Future Steps

This project is still in early development and is just the start.

- [ ] Build and support Nix flakes
- Lanauge support
* [x] NPM
* [x] Yarn
* [x] Golang
* [ ] Python
* [x] Rust
* [ ] Java
* [ ] Zip
* [ ] Crystal
* [ ] Ruby
- [ ] Environment variables
- [ ] Nix package version overriding
- [ ] NodeJS package.json engines parsing
## Language providers

At the moment nixpacks supports the following languages out of the box

- [x] NPM
- [x] Yarn
- [x] Golang
- [x] Rust
- [x] Deno
- [ ] Python
- [ ] Java
- [ ] Zip
- [ ] Crystal
- [ ] Ruby

## Contributing

Contributions are welcome with the big caveat that this is a very early stage project and the implementation details and API will most likely change between now and a stable release. For more details on how to contribute, please see the [Contributing guidelines](./CONTRIBUTING.md).

0 comments on commit 6140b53

Please sign in to comment.