@@ -20,7 +20,15 @@ The Nix sets up the development environment with:
20
20
21
21
The ` build.sbt ` points to ` clang ` binaries provided by the ` devshell ` .
22
22
23
- You can use this repo without ` nix ` if all of the above provided by your own environment (but will need to update the [ ` build.sbt ` ] ( ./build.sbt ) ).
23
+
24
+ ## TODOs
25
+ - [ ] non-Nix friendly.
26
+ - [ ] build and package with Nix Flakes.
27
+ - [ ] automatically build and publish the ELF and the unikernel image.
28
+ - [ ] continuous deployment to DigitalOcean.
29
+
30
+ ## Note on Nix
31
+ You can use this repo without ` nix ` if all of the above provided by your own environment, but you will need to update the [ ` build.sbt ` ] ( ./build.sbt ) .
24
32
25
33
As for ` nix ` users, ` cd ` into the repository directory and run ` nix develop ` to drop into the development environment.\
26
34
Or, if you have ` direnv ` installed, simply ` cd ` into the repository directory and do ` direnv allow ` .\
@@ -29,37 +37,42 @@ and erased when you `cd` out of the repository directory.
29
37
30
38
## Usage
31
39
32
- Build the binary: ` sbt nativeLink ` .\
40
+ Build the binary:\
41
+ ` sbt nativeLink ` .
33
42
34
43
Now, let's use the ` ops ` command to run it as a QEMU virtual machine packaged as unikernel.\
35
- It binds to the port 80, so we'll need ` sudo ` : ` sudo ops run --port 80 ./target/scala-3.6.3/unikernel-scala-out ` .
44
+ It binds to the port 80, so we'll need ` sudo ` :\
45
+ ` sudo ops run --port 80 ./target/scala-3.6.3/unikernel-scala-out ` .
36
46
37
47
38
- In another terminal window: ` curl localhost ` .\
48
+ In another terminal window:\
49
+ ` curl localhost ` .\
39
50
Output:
40
51
```
41
52
Hello from Scala Native NanoVM Unikernel! Your request: Request(method=GET, uri=/, httpVersion=HTTP/1.1, headers=Headers(Host: localhost, User-Agent: curl/8.11.0, Accept: */*), entity=Entity.Empty)
42
53
```
43
54
44
- Packaging: ` ops build ./target/scala-3.6.3/unikernel-scala-out ` .\
55
+ Packaging:\
56
+ ` ops build ./target/scala-3.6.3/unikernel-scala-out ` .
45
57
46
- Verify the image created: ` ops image list ` .\
58
+ Verify the image created:\
59
+ ` ops image list ` .\
47
60
Output:
48
61
```
49
62
100% |████████████████████████████████████████| [0s:0s]
50
63
100% |████████████████████████████████████████| [0s:0s]
51
64
Bootable image file:/home/igor/.ops/images/unikernel-scala-out.img
52
65
```
53
66
54
- The resulting image then can be deployed to any cloud hypervisor which uses QEMU, e.g. [ DigitalOcean] ( https://digitalocean.com ) .:\
67
+ The resulting image then can be deployed to any cloud hypervisor which uses QEMU, e.g. [ DigitalOcean] ( https://digitalocean.com ) .:
55
68
1 . "Create Droplet".
56
69
2 . "Choose Image" -> "Custom Images".
57
70
3 . "Add Image".
58
71
4 . Upload your image from ` ~/.ops/images/unikernel-scala-out.img ` .
59
72
5 . Wait for uploading the image and verification.
60
73
6 . On your image: "More" -> "Start Droplet".
61
74
62
- The app is currently deployed as ` http://unikernel.igorramazanov.tech ` :
75
+ The app is currently deployed as [ ` http://unikernel.igorramazanov.tech ` ] ( http://unikernel.igorramazanov.tech ) (you can simply open it in the browser) :
63
76
```
64
77
curl -v http://unikernel.igorramazanov.tech
65
78
@@ -93,8 +106,3 @@ instead of the traditional approach with [`coursier/setup-action`](https://githu
93
106
1 . https://github.com/DeterminateSystems/flake-checker-action
94
107
1 . https://github.com/DeterminateSystems/magic-nix-cache-action
95
108
96
- ## TODOs
97
- - [ ] non-Nix friendly.
98
- - [ ] build and package with Nix Flakes.
99
- - [ ] automatically build and publish the ELF and the unikernel image.
100
- - [ ] continuous deployment to DigitalOcean.
0 commit comments