Skip to content

The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.

4.1 KB
Raw Blame
{
  "name": "runner",
  "$schema": "../node_modules/nx/schemas/project-schema.json",
  "projectType": "application",
  "sourceRoot": "runner",
  "tags": [],
  "targets": {
    "build": {
      "executor": "@nx-go/nx-go:build",
      "options": {
        "main": "{projectRoot}/cmd/runner/main.go",
        "outputPath": "dist/apps/runner",
        "flags": ["-tags=boxlite_runner", "-ldflags \"-X 'github.com/boxlite-ai/runner/internal.Version=$VERSION'\""]
      },
      "dependsOn": ["check-version-env"],
      "inputs": [
        "goProduction",
        "^goProduction",
        { "env": "VERSION" },
        { "dependentTasksOutputFiles": "**/*", "transitive": true }
      ],
      "configurations": {
        "development": {
          "flags": ["-tags=boxlite_dev,boxlite_runner", "-ldflags \"-X 'github.com/boxlite-ai/runner/internal.Version=$VERSION'\""]
        }
      }
    },
    "build-amd64": {
      "executor": "@nx-go/nx-go:build",
      "options": {
        "main": "{projectRoot}/cmd/runner/main.go",
        "outputPath": "dist/apps/runner-amd64",
        "env": {
          "GOARCH": "amd64",
          "GOOS": "linux"
        },
        "flags": ["-tags=boxlite_runner", "-ldflags \"-X 'github.com/boxlite-ai/runner/internal.Version=$VERSION'\""]
      },
      "dependsOn": ["check-version-env"],
      "inputs": [
        "goProduction",
        "^goProduction",
        { "env": "VERSION" },
        { "dependentTasksOutputFiles": "**/*", "transitive": true }
      ]
    },
    "serve": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": ".",
        "command": "go run -tags boxlite_dev,boxlite_runner {projectRoot}/cmd/runner/main.go"
      },
      "configurations": {
        "production": {}
      }
    },
    "format": {
      "executor": "nx:run-commands",
      "options": {
        "command": "cd {projectRoot} && go fmt ./... && prettier --write \"**/*.{yaml,json}\""
      }
    },
    "test": {
      "executor": "nx:run-commands",
      "options": {
        "cwd": "{projectRoot}",
        "command": "go test -tags boxlite_dev,boxlite_runner ./..."
      }
    },
    "lint": {
      "executor": "@nx-go/nx-go:lint"
    },
    "openapi": {
      "executor": "nx:run-commands",
      "cache": true,
      "inputs": ["{projectRoot}/pkg/api/**/*.go", "!{projectRoot}/pkg/api/**/*_test.go"],
      "outputs": [
        "{projectRoot}/pkg/api/docs/swagger.json",
        "{projectRoot}/pkg/api/docs/swagger.yaml",
        "{projectRoot}/pkg/api/docs/docs.go"
      ],
      "options": {
        "cwd": "{projectRoot}/pkg/api",
        "command": "swag fmt && swag init --parseDependency --parseInternal --parseDepth 1 -o docs -g server.go && prettier --write \"**/*.{yaml,html,json}\""
      }
    },
    "check-version-env": {},
    "docker": {
      "options": {
        "target": "runner"
      },
      "dependsOn": ["check-version-env"]
    },
    "package-deb": {
      "executor": "nx:run-commands",
      "cache": true,
      "inputs": [
        "{projectRoot}/packaging/**/*",
        { "env": "VERSION" },
        { "dependentTasksOutputFiles": "**/*", "transitive": true }
      ],
      "outputs": ["{workspaceRoot}/dist/apps/runner-deb/**/*"],
      "options": {
        "commands": [
          "mkdir -p dist/apps/runner-deb/deb/opt/boxlite",
          "mkdir -p dist/apps/runner-deb/deb/etc/systemd/system",
          "mkdir -p dist/apps/runner-deb/deb/DEBIAN",
          "cp dist/apps/runner-amd64 dist/apps/runner-deb/deb/opt/boxlite/runner",
          "cp {projectRoot}/packaging/systemd/boxlite-runner.service dist/apps/runner-deb/deb/etc/systemd/system/",
          "cp {projectRoot}/packaging/deb/DEBIAN/postinst {projectRoot}/packaging/deb/DEBIAN/prerm {projectRoot}/packaging/deb/DEBIAN/postrm dist/apps/runner-deb/deb/DEBIAN/",
          "VERSION=${VERSION:-0.1.0} envsubst < {projectRoot}/packaging/deb/DEBIAN/control > dist/apps/runner-deb/deb/DEBIAN/control",
          "dpkg-deb --build dist/apps/runner-deb/deb dist/apps/runner-deb/boxlite-runner_${VERSION:-0.0.0-dev}_amd64.deb"
        ],
        "parallel": false
      },
      "dependsOn": ["build-amd64", "check-version-env"]
    },
    "push-manifest": {}
  }
}