Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
335 commits
Select commit Hold shift + click to select a range
615c97f
WIP: Add mount of extra volumes on VMs
hoh Jun 11, 2021
2f10edf
Cleanup: Remove deprecated comment
hoh Jun 11, 2021
eab5e6d
Fix: Variable is not always defined
hoh Jun 11, 2021
2c02525
Chore: Upgrade runtime Alpine version to 3.13.5
hoh Jun 11, 2021
05be382
Cleanup: Use Volume dataclass instead of dict
hoh Jun 11, 2021
11cc6e2
Create codeql-analysis.yml
hoh Jun 14, 2021
500dfcc
Fix: Improve script syntax and name container
hoh Jun 14, 2021
88179b4
Fix: VM Connector sign_message crashed
hoh Jun 14, 2021
082071b
Fix: Add support for Docker in SquashFS build
hoh Jun 11, 2021
9721b35
Fix: Wrong Python library specified in README
hoh Jun 14, 2021
8c2f373
Clean: Log when pip starts in disk image creation
hoh Jun 14, 2021
c91dce0
Feature: Add self-hosted CI builds
hoh Jun 11, 2021
ff2025d
WIP: Refactor: Configure Firecracker using JSON file
hoh Jun 15, 2021
9b17245
Fix: VM Supervisor Dockerfile missed dependencies
hoh Jun 15, 2021
d3c8ac8
Feature: Add support for code on Squashfs
hoh Jun 15, 2021
039cf2a
Feature: Allow amend for code, data and volumes
hoh Jun 16, 2021
cd974f7
Fix: Add shared_cache in message example
hoh Jun 16, 2021
827d5c2
Feature: Add Debian based runtime
hoh Jun 16, 2021
3e84d60
Feature: Switch rootfs to Squashfs
hoh Jun 16, 2021
8653861
Feature: Optimize Debian squashfs filesize
hoh Jun 16, 2021
03a5748
Feature: Add NodeJS in new default runtime
hoh Jun 16, 2021
8f3f760
Fix: A VM corouting kept hanging when the rootfs was invalid
hoh Jun 16, 2021
fb7b71d
Feature: Add API to list cache keys
hoh Jun 16, 2021
204d199
Fix: Apt failed in VM due to cache directory removed
hoh Jun 18, 2021
75a47d1
Feature: Add persistent volumes as ext4 partitions
hoh Jun 18, 2021
a044999
Fix: Redirect all requests to the same running VM
hoh Jun 30, 2021
f419341
Feature: Support persistent disk size specification
hoh Jun 30, 2021
eb94565
Fix: ASGI mandates lowercase header names
hoh Jul 1, 2021
4c68004
Fix: POST body was not passed to ASGI apps
hoh Jul 1, 2021
3b27179
Fix: ASGI did not support submodules
hoh Jul 1, 2021
750dd7b
Fix: Pass body to in ASGI scope as binary
hoh Jul 1, 2021
5bb27f2
Fix: Hash access failed on failed hashes with FAKE_DATA
hoh Jul 1, 2021
2da5ab8
Doc: Document the use of pool properties
hoh Jul 1, 2021
eefce5d
Fix: CI timeout of 5 minutes was cancelling the tests
hoh Jul 2, 2021
a6ad93e
Fix: Benchmark fake request headers were incorrect
hoh Jul 2, 2021
1b577a5
Chore: Use coherent fixed fake hash
hoh Jul 2, 2021
c18289a
Refactor: Rename example with fastapi
hoh Jul 2, 2021
bf51736
Feature: Add example using Django
hoh Jul 2, 2021
263e976
Fix: Use UUID as model ids in Django example
hoh Jul 7, 2021
107a805
Feature: Initialize DB and load fixture in Django example
hoh Jul 7, 2021
dc1cab6
Change: Supervisor listents on port 4020 instead of 8080
hoh Jul 8, 2021
fd0a10d
Refactor: Move init1 setup in separate function
hoh Jul 8, 2021
a247120
Feature: VM init can now handle asynchronous requests
hoh Jul 8, 2021
db3f92d
VMs would not update while running, and never if called more often th…
hoh Jul 14, 2021
06d097b
Feature: Expose execution info on HTTP endpoint
hoh Jul 14, 2021
31686aa
Feature: Expose Firecracker process info via /about
hoh Jul 15, 2021
2f54b5c
Feature: Expose supervisor config via /about
hoh Jul 15, 2021
4d15171
Refactor: Move time metrics to their own dataclass
hoh Jul 15, 2021
0e51b77
Fix: Document installing python3-psutil
hoh Jul 15, 2021
90e489c
Fix: Do not require psutil to be present
hoh Jul 15, 2021
3757651
Feature: Require a secret token to access /about pages
hoh Jul 15, 2021
8134587
Refactor: Reorganize code in smaller modules
hoh Jul 15, 2021
cf8485d
Reformat: Use `black` on Python code
hoh Jul 15, 2021
8313067
Feature: Install the supervisor from a Debian package
hoh Jul 15, 2021
e5fca8d
Refactor: Update the VM connector, install it from Docker Hub
hoh Jul 16, 2021
f011562
Documentation: Improve and update, split Caddy setup
hoh Jul 16, 2021
2ef82ee
Documentation: Add a tutorial to create programs
hoh Jul 16, 2021
c58fabd
Documentation: Start advanced usage tutorial
hoh Jul 16, 2021
b051485
Documentation: Fix .deb path in README.md
hoh Jul 16, 2021
5b4772c
Documentation: Fix filename inconsistency
hoh Jul 16, 2021
5c212db
fix msubscribe typo
aliel Jul 22, 2021
057ca42
[Doc] fix filename according to the commandline app.py -> main.py
aliel Jul 22, 2021
866b5c9
Update Architecture schema
hoh Jul 27, 2021
5a2c057
Fix: AWS vmlinux kernel is not compatible
hoh Jul 28, 2021
84d2dd7
Security fix: Document binding connector on 127.0.0.1
hoh Jul 28, 2021
80b3f38
Feature: Allow configuration of VM supervisor host
hoh Aug 24, 2021
5ad859e
Fix: VM connector port update was missing from guest API
hoh Aug 24, 2021
930119e
Fix: Example crashed when directory was missing
hoh Aug 24, 2021
7b143a2
Doc: Improve the tutorial and add Rust example
hoh Sep 1, 2021
cea89a8
Fix: Pool stored VM with failed setup (#80)
hoh Sep 15, 2021
fb62e92
Fix: Python tutorial requires FastAPI
hoh Sep 16, 2021
1c04722
Fix: aleph-client CLI requires eth_account
hoh Sep 16, 2021
676f640
Fix: Ethereum tools require eth_account, absent from runtime (#85)
hoh Sep 23, 2021
f44e9c2
Doc: Document custom domains
hoh Sep 23, 2021
1b4920b
Doc: Improve tutorial doc
hoh Sep 23, 2021
bba73fa
Doc: Fix typo in advanced tutorial
cpascariello Sep 23, 2021
fa905aa
Refactor: run_code -> run_code_on_request
hoh Sep 6, 2021
f3e19c2
Fix: Submodules did not work in zip entrypoints
hoh Sep 24, 2021
2af3ac5
Fix: Git ignore rootfs and squashfs archives
hoh Sep 24, 2021
c81647a
Fix: Exception was unclear when no message was found
hoh Sep 24, 2021
6fb071f
Feature: Run Aleph VMs in reaction to Aleph messages
hoh Sep 27, 2021
ae2b6c3
Fix: Network interface was not read from config
hoh Sep 27, 2021
55b4abe
Fix: SSH failed without a directory; Send SSH logs to stdout
hoh Sep 27, 2021
4385d00
Doc: Document how to upload Python packages in a VM
hoh Oct 11, 2021
40c5925
Fix: Default value missing from optional fields
hoh Nov 4, 2021
dc029ef
Feature: Add support for environment variables in programs
hoh Nov 4, 2021
da90eb5
Fix: Download kernel in supervisor Dockerfile
hoh Nov 4, 2021
f39bed0
Fix: Use enum instead of string to match type check
hoh Nov 4, 2021
bfd3e59
Fix: Typo in example created a tuple
hoh Nov 4, 2021
9c2f017
Fix: Errors within chroot did not raise an error
hoh Nov 4, 2021
28cbfbd
Fix: Some runtime dependencies now require a C compiler
hoh Nov 4, 2021
7cda855
Fix: Subscription is now a model
hoh Nov 4, 2021
5c45d36
Update the tutorial, add macOS instructions using Vagrant
leirbag95 Nov 9, 2021
66b7ac8
Fix: HTTP partial transfer caused issues
hoh Nov 15, 2021
d7f7be5
Fix: Pipe to set root password did not work
hoh Nov 15, 2021
26d7643
Fix: Example index was missing /environ endpoint
hoh Nov 15, 2021
0c4a03d
Fix: Using coroutine() is deprecated
hoh Nov 16, 2021
f860ffc
Internal: os.system did not raise an error on failure
hoh Nov 16, 2021
29d54fd
Logging: setfacl can fail without being problematic
hoh Nov 16, 2021
2725ce6
Fix: Expiration coroutine was not cancelled on VM stop
hoh Nov 16, 2021
963ef7e
Cleanup: Add type annotation
hoh Nov 16, 2021
276555a
Internal: There was no convenient way to stop all VMs in a pool
hoh Nov 16, 2021
097a5ce
Fix: Networking can work inside a Podman container
hoh Nov 16, 2021
6a3922d
Comment: Explain why variable stays empty
hoh Nov 16, 2021
39d0871
Fix: Shared cache should be enabled in example message
hoh Nov 16, 2021
5960918
Fix: Content-length header could appear twice, raising an error
hoh Nov 16, 2021
bf47f01
Fix: Exceptions catching in example was too broad
hoh Nov 16, 2021
a1c9948
Feature: Add page to check if VM works on deployment
hoh Nov 16, 2021
b22f99b
Feature: Improve fake data configuration
hoh Nov 17, 2021
8a4cb17
Feature: Add setting to avoid watching for new messages
hoh Nov 17, 2021
af3cfe8
Fix: chpasswd was not found, hidden in /usr/sbin
hoh Nov 17, 2021
24ba884
Security: Limit max size of inline zip archives
hoh Nov 17, 2021
9143d3d
Change: Improve running supervisor in a container
hoh Nov 17, 2021
131fc76
Problem: Podman was not supported in Docker launch scripts
hoh Nov 17, 2021
3a08b3d
Feature: Improve developer tools with Docker supervisor image
hoh Nov 17, 2021
a4ae508
Fix: Typo in TESTING.md
hoh Nov 19, 2021
cc50f4b
Fix: Handle task cancellation error properly
hoh Nov 19, 2021
9e8821a
Feature: User could not see which version a VM is running
hoh Dec 2, 2021
d1ea591
Fix: Unhandled errors would crash the websocket subscription
hoh Dec 13, 2021
ee28d8a
Fix: Watch for message ref==None was not properly handled
hoh Dec 13, 2021
884c90f
Fix: JSON decoding errors were not handled in websocket subscription
hoh Dec 13, 2021
8103af4
Logging: Lack of details made exceptions difficult to analyze
hoh Dec 13, 2021
1a2251c
Fix: Websocket subscription would not reconnect if disconnected
hoh Dec 13, 2021
fd7037a
Fix: Mypy rejected some annotations
hoh Dec 13, 2021
db901dd
Cleanup: Use black
hoh Dec 13, 2021
b89dcb8
Fix: Confirmation messages always displayed an exception with traceback
hoh Dec 13, 2021
6790031
Refactor: Rename `example_fastapi_2` -> `example_fastapi`
hoh Dec 14, 2021
a283a86
Feature: Add Rust example program
hoh Dec 14, 2021
11813b0
Feature: Add Node JS example program
hoh Dec 14, 2021
4b8ae19
Fix: Init timeout for HTTP executables was reached regularly on slow …
hoh Dec 14, 2021
31c01c0
Feature: Build Debian package within a container using Make
hoh Dec 14, 2021
72047ac
Feature: Build Debian package on GitHub Actions
hoh Dec 14, 2021
3a15922
Doc: Update README quick install to version 0.1.6
hoh Dec 28, 2021
3a69a3e
Doc: Update recommended OS to Debian 11
hoh Dec 28, 2021
c67674c
Fix: Runtime code directory was inconsistent depending on Zip/Squashf…
hoh Dec 14, 2021
7aadcac
Doc: Fix README, creating Caddyfile requires sudo
hoh Jan 12, 2022
1ce1ed0
Fix: Deb Package missed fake data for diagnostic
hoh Jan 12, 2022
e037c04
GitHub: Add issue templates
hoh Jan 13, 2022
ff9473f
Feature: Build Ubuntu 20.04 Debian packages
hoh Jan 13, 2022
64772b8
Feature: Add Debian repository management for Bullseye and Focal
hoh Jan 13, 2022
e44ccd5
Update .deb URL in README.md
hoh Jan 13, 2022
b8c448b
Fix: Typo in README.md
hoh Jan 13, 2022
0c7c947
Update README.md with network configuration
hoh Jan 13, 2022
142df69
Feature: Add index page with diagnostic
hoh Jan 14, 2022
1de4afd
Fix: FastAPI example failed due to missing volume
hoh Jan 14, 2022
66e50a8
Internal: Mount vm_supervisor in container for faster development
hoh Jan 14, 2022
09afeb2
Fix: Freeze dependency versions in runtime
hoh Jan 14, 2022
766f124
Fix: Old check VM was incompatible due to renaming
hoh Jan 17, 2022
48d2f03
Version 0.1.7
hoh Jan 17, 2022
352209a
Fix: Better cleanup on Debian package removal
hoh Jan 17, 2022
8883136
Doc: Update README quick install
hoh Jan 17, 2022
f400035
Doc: Ubuntu requires DNS using resolvectl
hoh Jan 17, 2022
5e0ff11
Doc: Update README.md
hoh Jan 18, 2022
362cd1c
Doc: Update README.md to discourage editing conf.py
hoh Jan 19, 2022
470de9e
Doc: Remove advanced configuration, use diagnostic for check
hoh Jan 19, 2022
a6542c8
Fix: Redis connections were accumulating
hoh Jan 24, 2022
8971680
Fix: A directory with the numerical id of the VM was not deleted
hoh Jan 26, 2022
f385bfe
Feature: Admin could not distinguish guest_api among running processes
hoh Jan 26, 2022
9f48eb3
Internal: Package `firecracker` was not mounted in development container
hoh Jan 26, 2022
6cfbd53
Fix: VM were not properly shutdowm, persistent volumes could be corru…
hoh Jan 24, 2022
6a7e3e2
Feature: Publish artifacts from GH actions
hoh Jan 26, 2022
8179416
Fix: Runtime rootfs was making packages very heavy
hoh Jan 26, 2022
162515a
Packaging: Version had to be updated manually
hoh Jan 26, 2022
41c9d6c
Fix: Config file was overwritten on package upgrade
hoh Jan 26, 2022
68f0b4d
Doc: Update quick install for version 0.1.9
hoh Jan 26, 2022
a41303c
Fix: VMs were not properly shutdown on executor stop
hoh Feb 8, 2022
de54cc6
Fix: Shutdown procedure did not handle premature stop of the VM
hoh Feb 8, 2022
4f0dd35
Feature: Add support for error monitoring on Sentry
hoh Feb 8, 2022
4441867
Fix: Unhandled error class during shutdown
hoh Feb 8, 2022
6c3233b
[Doc] Fixed typos
odesenfans Feb 9, 2022
361645d
Fix: Users could now identify missing hash
hoh Feb 14, 2022
eb2de3f
Fix: VM resource seconds field was ignored
hoh Feb 14, 2022
9c9e199
Fix: Sentry DSN appeared in clear in the logs
hoh Feb 14, 2022
929919f
Doc: Package installation was difficult to follow
hoh Feb 14, 2022
2b373ce
Fix: forget_vm called twice when VM init times out
hoh Feb 10, 2022
83a673c
Doc: Install version 0.1.10 in the doc.
hoh Feb 16, 2022
0dd5849
Fix: Undefined variable crashed `stop_all_vms()`
hoh Mar 22, 2022
e405cc2
Fix: Login URL displayed `https` on localhost
hoh Mar 22, 2022
d80fb43
Cleanup: Add type hints and better error message
hoh Mar 22, 2022
10214e9
Fix: `make clean` did not remove source copy
hoh Mar 22, 2022
be47d68
Change: Store Aleph variable files in `/var/` instead of `/tmp` and `…
hoh Mar 22, 2022
b01573e
Problem: Users could not know the version of Aleph-VM for diagnostic
hoh Mar 21, 2022
e55c73a
Problem: Developers had no easy way to know which Python dependencies…
hoh Mar 24, 2022
80ee7b7
Build(deps): Bump psutil from 5.5.1 to 5.6.6 in /packaging
dependabot[bot] Mar 28, 2022
eb03e3f
Build(deps): Bump aiohttp from 3.6.2 to 3.7.4 in /packaging
dependabot[bot] Mar 28, 2022
ba9ea3f
Cleanup: Remove unnecessary type annotations
hoh Mar 24, 2022
2bbc59f
Feature: Record VM execution times and log details on files.
hoh Mar 22, 2022
227ecd3
WIP: In response to PR comments
hoh Mar 24, 2022
b9d93a5
Fix: Querying index with HTTP HEAD raised 500 due to AssertionError
hoh Mar 10, 2022
34c179a
Dependency: Upgrade Firecracker to v1.0.0
hoh Mar 28, 2022
29c18b3
Fix: Service was not stopped during upgrade
hoh Mar 28, 2022
cd1e108
Change: Move jailer files from /srv/jailer to /var/lib/aleph/vm/jailer
hoh Mar 28, 2022
84236b1
Fix: Manual install missed some packages
hoh Mar 28, 2022
a68e0c9
Doc: Mention reboot since many installations ship outdated kernel
hoh Mar 28, 2022
bd438d1
Cleanup: Use `black` formatter
hoh Mar 29, 2022
b2e113e
Fix: Jailer process did not receive new jail chroot base
hoh Mar 29, 2022
6535c7a
Fix: Path contained duplicated "volumes" element
hoh Mar 29, 2022
1073fbf
Fix: Package postrm/postinst failed if directory was missing
hoh Mar 31, 2022
82e7f5d
Fix: Cargo.toml file was missing from Rust example
hoh Apr 27, 2022
c6de09e
Fix: Developer Dockerfile was obsolete and broken
hoh Apr 26, 2022
9163c13
Fix: Database access during benchmarks errored
hoh Apr 26, 2022
639e515
Feature: Developer could not run custom command in container
hoh Apr 26, 2022
04fb5f8
Fix: Getting version from git crashed when git was missing or on shal…
hoh Apr 26, 2022
ffa11be
[Doc] Fix typos
odesenfans Apr 28, 2022
356e374
Fix: Users could not tell if redacted fields were empty
hoh Apr 26, 2022
36bc57c
Fix: Incomplete file download could lead to inconsistent state (#177)
hoh May 1, 2022
d00ed76
Fix: Process metrics crashed if process was already stopped (#169)
hoh May 1, 2022
7dd5a87
Fix: Mime type of all files was not application/(g)zip.
hoh May 3, 2022
c40cc6b
Fix: Remove code duplication
hoh May 3, 2022
3196b4f
Fix: Argument `use_latest` was never used.
hoh May 3, 2022
9adf4f1
Feature: User could not easily access the current version of the soft…
hoh May 3, 2022
ed39a38
Fix: Response body requires bytes, was given str
hoh May 11, 2022
471ab9b
Fix: AttributeError crashed VM teardown
hoh May 8, 2022
e8fd32b
Feature: Load balancer could not distinguish outdated supervisors
hoh May 11, 2022
cbabe94
Internal: Enhance typing
hoh May 11, 2022
76afc09
Change: Use the load balancer instead of api2
hoh May 11, 2022
f937b41
Feature: Allow to run CI in a DigitalOcean Droplet
hoh May 11, 2022
3ebfbb0
Tests: Install from package in a Droplet
hoh May 11, 2022
3f74a36
Tests: Test fastapi check in the Actions Droplet
hoh May 18, 2022
a449957
Fix: Software version could not be fetched from apt
hoh May 19, 2022
084156b
Fix: Software version in apt is hardcoded during build
hoh May 19, 2022
0664812
Doc: Use v 0.2.1 instead of 0.1.10
hoh May 19, 2022
60c8641
Fix: Lib `packaging` was not added to Dockerfile
hoh May 23, 2022
178c800
Internal: Require aleph-message>=0.1.19
hoh May 31, 2022
7378869
Fix: Concurrent requests could result in a different counter value
hoh May 30, 2022
dbd86f9
Chore: Update firecracker to 1.1.0
hoh Jun 23, 2022
22d6400
Internal: Raise exception VmInitNotConnected when VM init cannot be r…
hoh Jun 22, 2022
36b04a5
Fix: Settings with implicit annotations were not displayed
hoh Jun 22, 2022
0800280
Fix: Recording VM usage crashed if process had stopped beforehand
hoh Jun 22, 2022
277e5f7
Refactoring: Move creation of VM execution in a separate function
hoh Jun 22, 2022
5128e08
Fix: A VM would not restart if the init process crashes
hoh Jun 22, 2022
73bcb01
Chore: Update kernel to 5.10
hoh Jun 23, 2022
9b2b52a
Fix: Pubsub subscribers did not get all relevant messages
hoh Jul 4, 2022
649aaa8
Doc: Format of Caddy GPG is now armored, did not work anymore
hoh Jul 4, 2022
0e2fad4
Chore: Cleanup internal logging
hoh Jul 4, 2022
bfeca7a
Fix: VM config files were never closed
hoh Jul 4, 2022
0dca97c
Fix: VM id counter values too high could cause issues in IP ranges
hoh Jul 4, 2022
2e3cdba
Fix: VM unix socket were never closed
hoh Jul 4, 2022
19d3472
Fix: Pubsub queues were not discarded after use
hoh Jul 4, 2022
fd218b1
Fix: VM id counter values too high could cause issues in IP ranges
hoh Jul 5, 2022
d6c3b9e
Release 0.2.3
hoh Jul 5, 2022
207cb52
Fix: Error in variable name
hoh Jul 5, 2022
4ff685c
Fix: Stability issues when checking crash handling in monitored endpoint
hoh Jul 14, 2022
abc1931
Release 0.2.4
hoh Jul 14, 2022
1dfc6d3
CI: Building example volume using Docker failed
hoh Aug 1, 2022
0e086f4
Fix: Examples doc typos
RezaRahemtola Aug 1, 2022
a722351
Fix: Network was depending on system logs print
hoh Jul 29, 2022
f568134
Doc: Add macOS instructions in README.md
mrhouzlane Aug 14, 2022
a46af2e
Fix: Watching for updates could be started multiple times
hoh Jun 29, 2022
1a16a09
Fix: Could not save multiple execution records for the same execution
hoh Jul 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
**/*.pyc
**/__pycache__

**/rootfs/
**/*.sqlite3
# **/*.squashfs
**/*.bin
**/*.ext4
**/*.zip
**/*.pyz
**/*.rdb
**/*.key
**/data.tgz
/pydantic/
**/target
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/scripts/extract_droplet_ipv4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python3
"""
Extract the IP address of a DigitalOcean Droplet
from the JSON returned by `doctl compute droplet get $name --output json
"""

import json
import sys

droplet_info = json.load(sys.stdin)
print(droplet_info[0]["networks"]["v4"][0]["ip_address"])
69 changes: 69 additions & 0 deletions .github/workflows/build-deb-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "Build Packages"
on:
push

jobs:
build_deb:
name: "Build Debian Package"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Unshallow
run: |
git fetch --prune --unshallow
git describe --tags

- run: |
cd packaging && make all-podman-debian-11 && cd ..
cd packaging && make all-podman-ubuntu-2004 && cd ..
ls packaging/target

- uses: actions/upload-artifact@v2
with:
name: aleph-vm.debian-11.deb
path: packaging/target/aleph-vm.debian-11.deb

- uses: actions/upload-artifact@v2
with:
name: aleph-vm.ubuntu-20.04.deb
path: packaging/target/aleph-vm.ubuntu-20.04.deb


build_rootfs:
name: "Build runtime aleph-debian-11-python"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- run: |
sudo apt update
sudo apt install -y debootstrap
cd runtimes/aleph-debian-11-python && sudo ./create_disk_image.sh && cd ../..

- uses: actions/upload-artifact@v2
with:
name: aleph-debian-11-python.squashfs
path: runtimes/aleph-debian-11-python/rootfs.squashfs


build_example_venv_volume:
name: "Build example squashfs volume using Docker"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- run: |
docker build -t aleph-vm-build-squashfs -f examples/volumes/Dockerfile examples/volumes
docker run --rm -v "$(pwd)":/mnt aleph-vm-build-squashfs

- uses: actions/upload-artifact@v2
with:
name: example-volume-venv.squashfs
path: volume-venv.squashfs
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '15 16 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
44 changes: 44 additions & 0 deletions .github/workflows/test-build-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@


name: "Build Examples"
on:
push

jobs:
build_pip:
name: "Build with Pip requirements"
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- run: |
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install python3-pip python3-venv squashfs-tools build-essential

sudo mkdir /opt/packages
sudo chown $(whoami) /opt/packages

- run: |
pip3 install aleph-client

- run: |
ls -la

- run: |
ls
pwd
pip3 install -t /opt/packages -r ./examples/example_pip/requirements.txt
mksquashfs /opt/packages packages.squashfs

# - run: |
# ipfs add packages.squashfs

# TODO: There is currently no easy way pass the item_hash from a pin to a new program.
# - run: |
# aleph pin QmQr3dEd6LiFq6JmUJYPLrffy45RGFhPWsxWmzo9zZb7Sy
#
# - run: |
# aleph program ./examples/example_pip main:app
73 changes: 73 additions & 0 deletions .github/workflows/test-on-droplet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Run tests on DigitalOcean Droplet"
on:
push

jobs:
build_deb:
name: "Run in DigitalOcean Droplet"
runs-on: ubuntu-latest
concurrency: droplet-aleph-vm

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0

- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}

- name: Setup SSH private key
run: |
mkdir ~/.ssh
echo $DIGITALOCEAN_SSH_PRIVATE_KEY | base64 --decode > ~/.ssh/id_ed25519
chmod 0700 ~/.ssh
chmod 0600 ~/.ssh/id_ed25519
env:
DIGITALOCEAN_SSH_PRIVATE_KEY: ${{ secrets.DIGITALOCEAN_SSH_PRIVATE_KEY }}

- name: Create the Droplet
run: |
doctl compute droplet create --image debian-11-x64 \
--size s-1vcpu-1gb --region ams3 aleph-vm-ci \
--ssh-keys 18:09:36:58:79:44:bb:84:45:c8:6f:9a:f6:b8:0a:c5

- name: Build Debian Package
run: |
cd packaging && make all-podman-debian-11 && cd ..
ls packaging/target

- name: Wait for the system to setup and boot
run: |
export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci --output json | ./.github/scripts/extract_droplet_ipv4.py)"
until ssh-keyscan -H ${DROPLET_IPV4}; do sleep 1; done

- name: Install Aleph-VM on the Droplet
run: |
export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci --output json | ./.github/scripts/extract_droplet_ipv4.py)"
ssh-keyscan -H ${DROPLET_IPV4} > ~/.ssh/known_hosts

ssh root@${DROPLET_IPV4} "apt-get update"
ssh root@${DROPLET_IPV4} "apt-get upgrade -y"
ssh root@${DROPLET_IPV4} "apt-get install -y docker.io apparmor-profiles"
ssh root@${DROPLET_IPV4} "docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha"

scp packaging/target/aleph-vm.debian-11.deb root@${DROPLET_IPV4}:/opt
ssh root@${DROPLET_IPV4} "apt install -y /opt/aleph-vm.debian-11.deb"
ssh root@${DROPLET_IPV4} "echo ALEPH_VM_SUPERVISOR_HOST=0.0.0.0 >> /etc/aleph-vm/supervisor.env"
ssh root@${DROPLET_IPV4} "systemctl restart aleph-vm-supervisor"

- name: Test Aleph-VM on the Droplet
run: |
export DROPLET_IPV4="$(doctl compute droplet get aleph-vm-ci --output json | ./.github/scripts/extract_droplet_ipv4.py)"

sleep 3
curl --retry 5 "http://${DROPLET_IPV4}:4020/status/check/fastapi"

- name: Cleanup
if: always()
run: |
doctl compute droplet delete -f aleph-vm-ci
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,25 @@
*.pyc
__pycache__

*.sqlite3
*.bin
*.ext4
*.zip
*.pyz
*.tgz
*.rdb
*.key
/pydantic/
node_modules
*.squashfs
/examples/example_http_rust/target/
/examples/example_django/static/admin/
/runtimes/aleph-debian-11-python/rootfs/
/packaging/aleph-vm/opt/
/packaging/target/
/packaging/repositories/*/db/
/packaging/repositories/*/dists/
/packaging/repositories/*/pool/
/kernels/linux-*/
/kernels/linux-*.tar
/kernels/linux-*.tar.sign
Loading