Skip to content

Commit

Permalink
update (#14)
Browse files Browse the repository at this point in the history
* update

* Create deno.lock

Signed-off-by: FortiShield <161459699+FortiShield@users.noreply.github.com>

---------

Signed-off-by: FortiShield <161459699+FortiShield@users.noreply.github.com>
  • Loading branch information
FortiShield authored Jun 12, 2024
1 parent 749b3eb commit 5cec9f3
Show file tree
Hide file tree
Showing 271 changed files with 15,612 additions and 66,171 deletions.
17 changes: 16 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
FROM mcr.microsoft.com/devcontainers/rust:1-1-bookworm
FROM mcr.microsoft.com/devcontainers/rust:dev-1-bookworm

ARG TARGETPLATFORM
ARG ONNXRUNTIME_VERSION

RUN apt-get update && apt-get install -y build-essential cmake libclang-dev lldb \
nodejs npm hyperfine

COPY scripts/install_onnx.sh /tmp/install_onnx.sh
COPY scripts/download_models.sh /tmp/download_models.sh

WORKDIR /tmp
RUN ./install_onnx.sh $ONNXRUNTIME_VERSION $TARGETPLATFORM /usr/local/bin/libonnxruntime.so
RUN ./download_models.sh
RUN mkdir -p /etc/sb_ai && cp -r /tmp/models /etc/sb_ai/models

ENV ORT_DYLIB_PATH=/usr/local/bin/libonnxruntime.so
ENV SB_AI_MODELS_DIR=/etc/sb_ai/models
18 changes: 14 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"name": "Rust",
"build": {
"dockerfile": "Dockerfile"
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"ONNXRUNTIME_VERSION": "1.17.0"
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/jungaretti/features/make:1": {},
"ghcr.io/lee-orr/rusty-dev-containers/cargo-make:0": {}
},
Expand All @@ -16,13 +21,18 @@
"customizations": {
"vscode": {
"settings": {
"extensions.verifySignature": false
"extensions.verifySignature": false,
"lldb.launch.preRunCommands": [
"script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))"
]
},
"extensions": [
"rust-lang.rust-analyzer",
"eamodio.gitlens",
"ms-azuretools.vscode-docker"
"ms-azuretools.vscode-docker",
"ms-vscode.hexeditor",
"vadimcn.vscode-lldb"
]
}
}
}
}
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
target/
k6/
examples/
assets/
.vscodes/
.github/

scripts/*
!scripts/install_onnx.sh
!scripts/download_models.sh
5 changes: 0 additions & 5 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
packages: write
id-token: write
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: 'us-east-1'
- uses: docker/login-action@v2
with:
registry: public.ecr.aws
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.DOCKER_TOKEN }}

- id: build
uses: docker/build-push-action@v3
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.DOCKER_TOKEN }}

- uses: docker/setup-buildx-action@v2
with:
Expand Down Expand Up @@ -119,23 +119,13 @@ jobs:
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Merge multi-arch manifests
run: |
docker buildx imagetools create -t khulnasoft/edge-runtime:v${{ needs.release.outputs.version }} \
khulnasoft/edge-runtime@${{ needs.publish_x86.outputs.image_digest }} \
khulnasoft/edge-runtime@${{ needs.publish_arm.outputs.image_digest }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PROD_AWS_ROLE }}
aws-region: us-east-1

- name: Login to ECR
uses: docker/login-action@v2
with:
registry: public.ecr.aws
- name: Login to GHCR
uses: docker/login-action@v2
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Generated by Cargo
# will have compiled files and executables
debug/
target/
temp/
.idea/
.idea

.vscode/*
!.vscode/launch.template.jsonc
!.vscode/settings.template.jsonc

scripts/debug.sh

node_modules/
Expand Down
76 changes: 76 additions & 0 deletions .vscode/launch.template.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
Copy this file into '.vscode/launch.json' or merge its contents into your existing
configurations.
*/

{
"configurations": [
{
"name": "Debug Runtime",
"type": "lldb",
"request": "launch",
"cargo": {
"args": [
"build",
"--bin=edge-runtime",
"--features=cli/tracing"
],
"filter": {
"kind": "bin"
}
},
"cwd": "${workspaceFolder}",
"sourceLanguages": [
"rust"
],
"args": [
"-v",
"start",
"--main-service",
"./examples/main",
"--event-worker",
"./examples/event-manager"

// To enable the inspector capability, uncomment the line below.
// "--inspect-brk"

// If you want to listen to the inspect session on a different port, uncomment the
// line below instead.
// "--inspect-brk=127.0.0.1:<PORT>"

// If you want to allow an inspector session to be created on the main worker,
// uncomment the line below.
//
// This flag must be used in combination with the flag above.
// "--inspect-main"
],
"env": {
"RUST_BACKTRACE": "full",
"EDGE_RUNTIME_PORT": "9998"

// If you want to get a detailed log, uncomment below.
// Value of environment variable below is described in detail in the links below:
// https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives
// "RUST_LOG": "trace"
}
},
{
"name": "Attach V8 Inspector",
"type": "node",
"address": "127.0.0.1",
"request": "attach",
"localRoot": "/",
"remoteRoot": "/",
"timeout": 1000000,

// Properties below are optional.
"restart": true,

// Inspector is accepting sessions on 9229 by default. If you changed the listening port
// via the inspector flag above, this value must also be changed.
"port": 9229
}
]
}
21 changes: 21 additions & 0 deletions .vscode/settings.template.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copy this file into '.vscode/settings.json' or merge its contents into your existing
configurations.
*/

{
"lldb.launch.preRunCommands": [
"script lldb.debugger.HandleCommand('settings set target.source-map /rustc/{} \"{}/lib/rustlib/src/rust\"'.format(os.popen('rustc --version --verbose').read().split('commit-hash: ')[1].split('\\n')[0].strip(), os.popen('rustc --print sysroot').readline().strip()))"
],
"rust-analyzer.cargo.features": [
"cli/tracing"
],
"rust-analyzer.diagnostics.disabled": [
"E0308"
],
"editor.rulers": [
100
]
}
Loading

0 comments on commit 5cec9f3

Please sign in to comment.