Compare commits

..

8 Commits

Author SHA1 Message Date
Vladislav Drozdov ccf474922e
Update README.md
new options about deps and building
2024-09-04 10:50:28 +03:00
prplV aea7db7036 added aliases for building (example: cargo riscv64) 2024-09-04 10:22:25 +03:00
Vladislav Drozdov 11cc752d08
added valid repo link 2024-09-03 21:36:39 +03:00
Vladislav Drozdov 1e515389da
Update README.md 2024-09-03 21:34:22 +03:00
hydeonz dbc0e73cec
Update main.rs 2024-09-03 17:34:12 +03:00
hydeonz b19b99fcd6
Update Dockerfile 2024-09-03 17:25:54 +03:00
hydeonz 0282e601ab
Merge pull request #9 from prplV/hotfix/EN-7
Update Dockerfile
2024-09-03 17:21:17 +03:00
hydeonz 63273eb3bc
Update Dockerfile 2024-09-03 17:21:04 +03:00
4 changed files with 19 additions and 9 deletions

View File

@ -2,5 +2,9 @@
runner = "riscv64-unknown-elf-gdb -q -x gdb_init" runner = "riscv64-unknown-elf-gdb -q -x gdb_init"
linker = "riscv64-linux-gnu-gcc" linker = "riscv64-linux-gnu-gcc"
[alias]
x86_64 = "build --release"
riscv64 = "build --release --target riscv64gc-unknown-linux-gnu"
[build] [build]
target = "x86_64-unknown-linux-gnu" target = "x86_64-unknown-linux-gnu"

View File

@ -10,7 +10,7 @@ RUN touch services/temp-process/dep.txt
RUN touch services/temp-process/run.sh RUN touch services/temp-process/run.sh
RUN echo "./services/temp-process/temp-process" >> services/temp-process/run.sh RUN echo "./services/temp-process/temp-process" >> services/temp-process/run.sh
COPY runner-rs monitor/ COPY target/x86_64-unknown-linux-gnu/release/runner-rs monitor/
COPY settings.json . COPY settings.json .
COPY temp-process services/temp-process/ COPY temp-process services/temp-process/

View File

@ -6,21 +6,27 @@ in-container integrating util to handle processes runtime
## Depends on ## Depends on
- `rustup (>=1.27.1)` - `rustup (>=1.27.1)`
- `gcc-riscv64-unknown-elf`
- `build-essential`
## Setting up
Download and execute rustup.sh
~~~bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
~~~
## Building ## Building
1. Clone this repo `runner-rs` 1. Clone this repo `runner-rs`
~~~bash ~~~bash
git clone https://link-to-project git clone https://github.com/prplV/runner-rs
~~~ ~~~
2. Enter project's dir and set up toolchain list to compile code for RISC-V and AMD64 2. Enter project's dir and set up toolchain list to compile code for RISC-V and AMD64
~~~bash ~~~bash
cd runner-rs/ cd runner-rs/ && rustup target add riscv64gc-unknown-linux-gnu && rustup target add x86_64-unknown-linux-gnu
rustup target add riscv64gc-unknown-linux-gnu
rustup target add x86_64-unknown-linux-gnu
~~~ ~~~
> [!NOTE] > [!NOTE]
> Cargo is configured to build an app for amd64/linux defaultly. RISC-based compilation is optional. > Cargo is configured to build an app for amd64/linux defaultly. RISC-based compilation is optional.
@ -28,13 +34,13 @@ in-container integrating util to handle processes runtime
3.1. Release build of app for amd64/linux 3.1. Release build of app for amd64/linux
~~~bash ~~~bash
cargo build --release cargo x86_64
~~~ ~~~
3.2. Release build of app for riscv64/linux 3.2. Release build of app for riscv64/linux
~~~bash ~~~bash
cargo build --release --target riscv64gc-unknown-linux-gnu cargo riscv64
~~~ ~~~

View File

@ -16,7 +16,7 @@ use structs::*;
use config::*; use config::*;
use utils::*; use utils::*;
static GET_ID_CMD : &'static str = "cat /proc/self/mountinfo | grep '/docker/containers/' | head -1 | awk -F '/' '{print $5}'"; static GET_ID_CMD : &'static str = "cat /proc/self/mountinfo | grep '/docker/containers/' | head -1 | awk -F '/' '{print $6}'";
#[tokio::main(flavor = "multi_thread")] #[tokio::main(flavor = "multi_thread")]
@ -89,4 +89,4 @@ fn get_container_id() -> Option<String> {
None None
}, },
} }
} }