Skip to content

Commit 331c17f

Browse files
jprendesdanbugsdevigneddblnzjsturtevant
committed
Initial hyperlight-js commit
Co-authored-by: Dan Chiarlone <dchiarlone@microsoft.com> Co-authored-by: David Justice <devigned@users.noreply.github.com> Co-authored-by: Doru-Florin Blânzeanu <blanzeanu.doru@protonmail.com> Co-authored-by: James Sturtevant <jstur@microsoft.com> Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com> Co-authored-by: Jorge Prendes <jorge.prendes@gmail.com> Co-authored-by: Lucy Menon <168595099+syntactically@users.noreply.github.com> Co-authored-by: Ludvig Liljenberg <lliljenberg@microsoft.com> Co-authored-by: Mark Rossetti <marosset@microsoft.com> Co-authored-by: Ralph Squillace <ralph@squillace.com> Co-authored-by: Simon Davies <simongdavies@users.noreply.github.com> Co-authored-by: Tomasz Andrzejak <andreiltd@gmail.com>
0 parents  commit 331c17f

137 files changed

Lines changed: 22060 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// For more info on the configuration below, check out the link:
2+
// https://code.visualstudio.com/docs/devcontainers/create-dev-container
3+
{
4+
"name": "Hyperlight",
5+
6+
"image": "ghcr.io/hyperlight-dev/hyperlight-devcontainer:latest",
7+
8+
"containerUser": "vscode",
9+
// Environment for the container also used by the `postCreateCommand`
10+
"containerEnv": {
11+
"DEVICE": "/dev/kvm",
12+
"REMOTE_USER": "vscode",
13+
"REMOTE_GROUP": "vscode"
14+
},
15+
16+
"runArgs": [
17+
"--device=/dev/kvm"
18+
],
19+
20+
// use `postStartCommand` for additional setup commands
21+
// this is run after the container is created and the user has been added
22+
"postStartCommand": "bash .devcontainer/setup.sh",
23+
24+
"customizations": {
25+
"vscode": {
26+
"extensions": [
27+
"ms-vscode.cpptools-extension-pack",
28+
"ms-vscode.cmake-tools",
29+
"rust-lang.rust-analyzer",
30+
"vadimcn.vscode-lldb"
31+
],
32+
"settings": {
33+
"rust-analyzer.rustfmt.extraArgs": [
34+
"+nightly" // required for rustfmt.toml which uses nightly features
35+
]
36+
}
37+
}
38+
}
39+
}

.devcontainer/setup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# Change device ownership
4+
sudo chown -R $REMOTE_USER:$REMOTE_GROUP $DEVICE
5+

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Enforce LF line endings for all text files.
2+
# Prevents Windows `core.autocrlf = true` from checking out CRLF,
3+
# which breaks tools like Prettier that default to LF.
4+
* text=auto eol=lf

.github/codeql/codeql-config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: "CodeQL config"
2+
queries:
3+
- uses: security-and-quality
4+
5+
query-filters:
6+
- exclude:
7+
id: actions/unpinned-tag

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "03:00"
8+
- package-ecosystem: "cargo"
9+
directories:
10+
- "/"
11+
schedule:
12+
interval: "daily"
13+
time: "03:00"
14+
- package-ecosystem: "npm"
15+
directory: "/src/js-host-api"
16+
schedule:
17+
interval: "daily"
18+
time: "03:00"

.github/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# .github/release.yml
2+
3+
changelog:
4+
exclude:
5+
labels:
6+
- chore
7+
- ignore
8+
categories:
9+
- title: 🛠 Breaking Changes
10+
labels:
11+
- breaking-change
12+
- title: 🎉 New Features
13+
labels:
14+
- enhancement
15+
- feature
16+
- title: 🐛 Bug Fixes
17+
labels:
18+
- bug
19+
- title: 🔒 Security Fixes
20+
labels:
21+
- security
22+
- title: 🚀 Performance Improvements
23+
labels:
24+
- performance
25+
- title: 👒 Dependencies
26+
labels:
27+
- dependencies
28+
- title: 📚 Documentation
29+
labels:
30+
- documentation
31+
- title: 🔬 Testing
32+
labels:
33+
- testing
34+
- title: 📝 Other Changes
35+
labels:
36+
- "*"

.github/workflows/CargoAudit.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Audit cargo dependencies for security vulnerabilities
2+
on:
3+
schedule:
4+
- cron: "0 9 * * 2" # run at 9am every Tuesday
5+
workflow_dispatch: # allow manual triggering
6+
7+
permissions:
8+
issues: write # Creates issues for any vulnerabilities found
9+
contents: read
10+
checks: write # Needs to create check
11+
12+
jobs:
13+
audit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
# We are not using the common workflow here because it installs a bunch of tools we don't need.
19+
# TODO: Once the runner image is updated to include the necessary tools (without downloading), we can switch to the common workflow.
20+
- uses: dtolnay/rust-toolchain@master
21+
with:
22+
toolchain: "1.89"
23+
24+
- uses: rustsec/audit-check@v2.0.0
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Create a Release
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches: [dev]
9+
10+
permissions:
11+
id-token: write
12+
contents: write # needed to create a release
13+
14+
jobs:
15+
build:
16+
uses: ./.github/workflows/dep_build.yml
17+
secrets: inherit
18+
with:
19+
environment: release
20+
benchmarks:
21+
uses: ./.github/workflows/dep_benchmarks.yml
22+
secrets: inherit
23+
with:
24+
download-benchmarks: true
25+
upload-benchmarks: true
26+
environment: release
27+
28+
publish-hyperlight-js-packages-and-create-release:
29+
needs: [build, benchmarks]
30+
environment: release
31+
runs-on: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"]
32+
if: ${{ contains(github.ref, 'refs/heads/release/') }}
33+
34+
steps:
35+
- uses: actions/checkout@v6
36+
with:
37+
fetch-depth: 0
38+
fetch-tags: true
39+
40+
# Ensures just is installed using setup wokflow to ensure just version consistency
41+
- name: Hyperlight setup
42+
uses: hyperlight-dev/ci-setup-workflow@v1.8.0
43+
with:
44+
rust-toolchain: "1.89"
45+
46+
- name: Set crate versions
47+
run: |
48+
git fetch --tags || true
49+
version=$(echo "${{ github.ref }}" | sed -E 's#refs/heads/release/v##')
50+
echo "Setting version to 'v$version'"
51+
echo "HYPERLIGHT_JS_VERSION=v$version" >> $GITHUB_ENV
52+
53+
- name: Publish hyperlight-js
54+
run: |
55+
cargo publish -p hyperlight-js-runtime
56+
cargo publish -p hyperlight-js
57+
58+
- name: Download benchmarks (Windows)
59+
uses: actions/download-artifact@v7
60+
with:
61+
name: benchmarks_Windows_whp
62+
path: benchmarks_Windows_whp
63+
64+
- name: Download benchmarks (Linux kvm)
65+
uses: actions/download-artifact@v7
66+
with:
67+
name: benchmarks_Linux_kvm
68+
path: benchmarks_Linux_kvm
69+
70+
- name: Download benchmarks (Linux hyperv3)
71+
uses: actions/download-artifact@v7
72+
with:
73+
name: benchmarks_Linux_hyperv3
74+
path: benchmarks_Linux_hyperv3
75+
76+
- name: Archive benchmarks
77+
run: |
78+
tar -zcvf benchmarks_Windows_whp.tar.gz benchmarks_Windows_whp
79+
tar -zcvf benchmarks_Linux_kvm.tar.gz benchmarks_Linux_kvm
80+
tar -zcvf benchmarks_Linux_hyperv3.tar.gz benchmarks_Linux_hyperv3
81+
82+
- name: Create GH Release
83+
run: |
84+
gh release create ${{ env.HYPERLIGHT_JS_VERSION }} \
85+
--generate-notes \
86+
benchmarks_Windows_whp.tar.gz \
87+
benchmarks_Linux_kvm.tar.gz \
88+
benchmarks_Linux_hyperv3.tar.gz
89+
env:
90+
GH_TOKEN: ${{ github.token }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
# When a git tag with the prefix 'v' is pushed to the repository, this workflow will create a new release branch called release/<tag name>.
4+
5+
name: Create a Release Branch
6+
7+
on:
8+
push:
9+
tags:
10+
- "v*"
11+
12+
permissions:
13+
contents: write # needed to push the new branch
14+
15+
jobs:
16+
create-branch:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- uses: extractions/setup-just@v3
23+
with:
24+
just-version: "1.40"
25+
26+
- name: Create Release Branch
27+
run: |
28+
git checkout -b release/${GITHUB_REF_NAME}
29+
git push --set-upstream origin release/${GITHUB_REF_NAME}
30+
shell: bash
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Issue Labeler
2+
on:
3+
issues:
4+
types: [opened]
5+
6+
permissions:
7+
issues: write
8+
contents: read
9+
10+
jobs:
11+
labeler:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- name: Check and Add label
16+
run: |
17+
LABELS=$(gh issue view ${{ github.event.issue.number }} --json labels -q '.labels[].name')
18+
if [[ $LABELS != *"needs review"* ]]; then
19+
gh issue edit ${{ github.event.issue.number }} --add-label "needs review"
20+
fi
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)