Skip to content

Commit

Permalink
Merge branch 'nightly' into release/stable/bin/nanocl/0.11.0
Browse files Browse the repository at this point in the history
Signed-off-by: leone <[email protected]>
  • Loading branch information
leon3s authored Nov 6, 2023
2 parents 65da561 + 24b0790 commit 07ff602
Show file tree
Hide file tree
Showing 72 changed files with 432 additions and 782 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ jobs:
cargo build --no-default-features --features test --bin ncproxy
cargo build --no-default-features --features test --bin nanocld
docker compose -f ./tests/docker-compose.yaml up -d
cargo run --no-default-features --features test --bin nanocld -- --init
cargo run --no-default-features --features test --bin nanocld -- --hosts tcp://0.0.0.0:8585 &
sleep 4
sudo chown $USER:$USER -R ~/.nanocl_dev
cargo run --no-default-features --features test --bin nanocld -- --hosts tcp://0.0.0.0:8585 --state-dir ~/.nanocl_dev/state &
sleep 8
sudo mkdir -p /etc/nginx
sudo chmod 777 -R /run/nanocl
Expand Down
34 changes: 20 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ bin # Binaries (executable)
├── ndns # Source to build custom dnsmasq container image
└── nproxy # Source to build custom nginx container image
crates # Shared Libraries
├── nanocl_error # Error utils used in the porject
│   └── src # The rust source code
├── nanocl_stubs # Shared data structure mostly used as input and output of the DAEMON
│   └── src # The rust source code
├── nanocld_client # A nanocld client
│   └── src # The rust source code
├── nanocl_utils # A collection of utils used in the project
│   └── src # The rust source code
└── nanocl_stubs # Shared data structure mostly used as input and output of out DAEMON
└── nanocld_client # A nanocld client
└── src # The rust source code
```

Expand Down Expand Up @@ -115,19 +119,22 @@ Before running `Nanocl` we will need to download and build some docker images:
./scripts/install_dev_image.sh
```

Then spin up `Nanocl` services using `docker compose` (note that you need use vpnkit profile for docker desktop [see below](#docker-desktop)):
Then spin up `Nanocl` services using `docker compose`.

> [!NOTE]
> You need use `vpnkit` profile for docker desktop [see below](#docker-desktop)
```sh
docker compose up
```

### 🐋 Docker Desktop

With Docker Desktop you'll need an additional container, to enable it run docker compose with profile `vpnkit`

```sh
docker compose --profile vpnkit up
```
> [!IMPORTANT]
> With Docker Desktop you'll need an additional container, to enable it run docker compose with `vpnkit` profile
> ```sh
> docker compose --profile vpnkit up
> ```
If you can have Docker installed normally with his default socket on `/var/run/docker.sock` you can also change the context:
Expand All @@ -147,12 +154,6 @@ Once started, a swagger should be available on [http://localhost:8585/explorer](
Note that a _env variable_ could be passed to change the port, it is hardcoded for now.<br />
It could be a nice and easy first issue and pull request if you would like to help :).

To use the CLI you need correct permission on `/run/nanocl`

```sh
sudo chmod -R /run/nanocl
```

Now you can run the CLI:

- Using cargo make
Expand All @@ -170,14 +171,19 @@ Now you can run the CLI:
## 🧪 Testing

To run tests, make sure all `Nanocl` services are running with `docker compose up`.<br/>
Then be sure to have correct permission set on `/run/nanocl`<br />
You also need theses entries in your `/etc/hosts`

```
127.0.0.1 nstore.nanocl.internal
127.0.0.1 ndaemon.nanocl.internal
```
Then you need to chown the state directory to be able to read SSL/TLS certificate to connect to the database
```sh
sudo chown $USER:$USER -R ~/.nanocl_dev
```

- Run all tests

```sh
Expand Down
126 changes: 64 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion bin/nanocl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ test = []
[build-dependencies]
liquid = "0.26.1"
tabled = "0.14.0"
clap_complete = "4.4.2"
clap_mangen = { version = "0.2" }
clap = { version = "4.4.5", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }
Expand Down
Loading

0 comments on commit 07ff602

Please sign in to comment.