Skip to content

Commit

Permalink
fix(pegboard): get pb running on edge
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Sep 29, 2024
1 parent 1aff715 commit d6c0411
Show file tree
Hide file tree
Showing 33 changed files with 134 additions and 435 deletions.
4 changes: 2 additions & 2 deletions infra/tf/infra_artifacts/container_runner.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
locals {
container_runner_src_dir = "${path.module}/../../../lib/container-runner"
container_runner_src_dir = "${path.module}/../../../lib/pegboard/container-runner"

container_runner_src_files = flatten([
["${local.container_runner_src_dir}/Cargo.toml", "${local.container_runner_src_dir}/Cargo.lock"],
["${local.container_runner_src_dir}/Cargo.toml"],
[for f in fileset("${local.container_runner_src_dir}/src/", "**/*"): "${local.container_runner_src_dir}/src/${f}"],
])
container_runner_src_hash = md5(join("", [
Expand Down
2 changes: 1 addition & 1 deletion infra/tf/infra_artifacts/job_runner.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ locals {
job_runner_src_dir = "${path.module}/../../../lib/job-runner"

job_runner_src_files = flatten([
["${local.job_runner_src_dir}/Cargo.toml", "${local.job_runner_src_dir}/Cargo.lock"],
["${local.job_runner_src_dir}/Cargo.toml"],
[for f in fileset("${local.job_runner_src_dir}/src/", "**/*"): "${local.job_runner_src_dir}/src/${f}"],
])
job_runner_src_hash = md5(join("", [
Expand Down
10 changes: 6 additions & 4 deletions infra/tf/infra_artifacts/pegboard_manager.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
locals {
pegboard_manager_src_dir = "${path.module}/../../../lib/pegboard-manager"
pegboard_manager_src_dir = "${path.module}/../../../lib/pegboard/manager"
# Where the docker command is ran from
src_dir = "${path.module}/../../.."

pegboard_manager_src_files = flatten([
["${local.pegboard_manager_src_dir}/Cargo.toml", "${local.pegboard_manager_src_dir}/Cargo.lock"],
["${local.pegboard_manager_src_dir}/Cargo.toml"],
[for f in fileset("${local.pegboard_manager_src_dir}/src/", "**/*"): "${local.pegboard_manager_src_dir}/src/${f}"],
])
pegboard_manager_src_hash = md5(join("", [
Expand All @@ -25,11 +27,11 @@ resource "null_resource" "pegboard_manager_build" {
# Variables
IMAGE_NAME="pegboard-manager:${local.pegboard_manager_src_hash}"
CONTAINER_NAME="temp-pegboard-manager-${local.pegboard_manager_src_hash}"
BINARY_PATH_IN_CONTAINER="/app/target/x86_64-unknown-linux-musl/release/pegboard-manager"
BINARY_PATH_IN_CONTAINER="/app/lib/pegboard/target/x86_64-unknown-linux-musl/release/pegboard-manager"
DST_BINARY_PATH="${local.pegboard_manager_dst_binary_path}"
# Build the Docker image
docker build --platform linux/amd64 -t $IMAGE_NAME '${local.pegboard_manager_src_dir}'
docker build --platform linux/amd64 -t $IMAGE_NAME -f '${local.pegboard_manager_src_dir}/Dockerfile' '${local.src_dir}'
# Create a temporary container
docker create --name $CONTAINER_NAME $IMAGE_NAME
Expand Down
2 changes: 0 additions & 2 deletions lib/bolt/core/src/tasks/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ async fn ip_inner(
"root",
"-i",
ssh_key.path(),
"-L",
"9090:10.0.0.84:8080",
ip,
)
.run()
Expand Down
337 changes: 0 additions & 337 deletions lib/job-runner/Cargo.lock

This file was deleted.

Loading

0 comments on commit d6c0411

Please sign in to comment.