{"id":46252011,"url":"https://github.com/openfactoryio/openfactory-sdk","last_synced_at":"2026-06-10T00:00:46.153Z","repository":{"id":307532058,"uuid":"1029452332","full_name":"openfactoryio/openfactory-sdk","owner":"openfactoryio","description":"OpenFacotry Software Development Kit ","archived":false,"fork":false,"pushed_at":"2026-06-08T22:00:21.000Z","size":177,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T00:04:04.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfactoryio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-31T04:37:36.000Z","updated_at":"2026-06-08T22:00:33.000Z","dependencies_parsed_at":"2025-07-31T20:35:09.259Z","dependency_job_id":"cfc6fd6b-cd15-441e-82be-47c350299577","html_url":"https://github.com/openfactoryio/openfactory-sdk","commit_stats":null,"previous_names":["openfactoryio/openfactory-sdk"],"tags_count":102,"template":false,"template_full_name":null,"purl":"pkg:github/openfactoryio/openfactory-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfactoryio","download_url":"https://codeload.github.com/openfactoryio/openfactory-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34130642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-03T22:32:52.420Z","updated_at":"2026-06-10T00:00:46.134Z","avatar_url":"https://github.com/openfactoryio.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFactory-SDK\n[![version](https://img.shields.io/github/release/openfactoryio/openfactory-sdk.svg?color=blue)](https://github.com/openfactoryio/openfactory-sdk/releases)\n[![OpenFactory SDK Feature](https://img.shields.io/badge/devcontainer-feature-blue?logo=visualstudiocode)](https://github.com/openfactoryio/openfactory-sdk/tree/main/.devcontainer/features)\n[![License](https://img.shields.io/github/license/openfactoryio/openfactory-sdk)](LICENSE)\n\n**OpenFactory Software Development Kit**\n\nThe **OpenFactory-SDK** provides tools to develop and test [OpenFactory](https://github.com/openfactoryio) applications in a simplified development environment. Instead of requiring a full OpenFactory and Kafka cluster setup, this SDK uses lightweight Docker containers to simulate the necessary infrastructure.\n\nThe SDK is delivered as a set of **Dev Container Features** that can be easily added to your development environment.\n\n## 🛠 Features\n\nCurrently, the SDK provides the following Dev Container features:\n\n| Feature ID        | Description                                                       |\n| ----------------- | ----------------------------------------------------------------- |\n| `infra`           | Simulates the OpenFactory infrastructure (Kafka Cluster + ksqlDB) |\n| `connectors`      | Deploys OpenFactory Connectors                                    |\n| `nfs-server`      | Provides a mocked NFS server for shared filesystem testing        |\n\nEach feature can be configured independently and further combined, depending on your development needs.\n\n## 🐳 Using OpenFactory-SDK in a Dev Container\n\nOnce installed, the features allow you to start and stop infrastructure and connector services via shell aliases.\n\n| Feature           | Start Command              | Stop Command                 |\n| ----------------- | -------------------------- | ---------------------------- |\n| OpenFactory Infra | `spinup`                   | `teardown`                   |\n| Connectors        | `\u003cconnector\u003e-connector-up` | `\u003cconnector\u003e-connector-down` |\n| Mocked NFS Server | `nfs-start`                | `nfs-stop`                   |\n\n\n## 🚀 Usage\n\nFor all use cases, it is recommended to use as base image `ghcr.io/openfactoryio/devcontainer-py3.XX`,\nwhere `XX` is the Python version you wish to use (currently 12, 13 or 14).\n\n### 1️⃣ OpenFactory Application Developers\n\nThese developers are building OpenFactory applications for a **specific OpenFactory version**. \nThey should **pin the SDK feature version** to match the version running in their factory.\nIt is further recommended to pin the version of the base image (e.g. `ghcr.io/openfactoryio/devcontainer-py3.14:v0.5.2`) in the same way.\n\nExample `.devcontainer/devcontainer.json`:\n\n```json\n{\n  \"features\": {\n    \"ghcr.io/devcontainers/features/docker-in-docker:3.0.1\": {},\n    \"ghcr.io/openfactoryio/openfactory-sdk/infra:0.6.1\": {},\n    \"ghcr.io/openfactoryio/openfactory-sdk/connectors:0.6.1\": {},\n    \"ghcr.io/openfactoryio/openfactory-sdk/nfs-server:0.6.1\": {}\n  }\n}\n```\n\n\u003e 💡 **Note:** The **feature version** must match the OpenFactory version running in your factory (e.g. 0.5.5). Pinning ensures the SDK features remain compatible with the OpenFactory deployment you are targeting.\n\n### 2️⃣ OpenFactory Core Developers\n\nThese developers contribute to OpenFactory itself. They usually want to use the **latest development version** of the SDK features and the latest OpenFactory version.\n\nExample:\n\n```json\n{\n  \"features\": {\n    \"ghcr.io/devcontainers/features/docker-in-docker:3.0.1\": {},\n    \"ghcr.io/openfactoryio/openfactory-sdk/infra:0.0.0-dev.05580d9\": {},\n    \"ghcr.io/openfactoryio/openfactory-sdk/connectors:0.0.0-dev.05580d9\": {}\n  }\n}\n```\n\n\u003e 📝 **Note:** The latest development versions of the SDK features can be found [here](https://github.com/openfactoryio/openfactory-sdk/pkgs/container/openfactory-sdk).\n\n---\n\n## ⚙️ Optional Settings\n\nEach feature provides optional configuration:\n\n| Feature           | Option ID                   | Description                                                     | Type    | Default Value               |\n| ----------------- | --------------------------- | --------------------------------------------------------------- | ------- | --------------------------- |\n| `infra`           | `openfactory-version`       | Git ref (branch, tag, or commit) of OpenFactory Core to install | string  | *(matches feature version)* |\n|                   | `useLocalSdk`               | Use the local SDK source code instead of installing from GitHub | boolean | `false`                     |\n| `connectors`      | `shdr-gateway-version`      | Git ref of the SHDR Gateway image to install                    | string  | *(matches feature version)* |\n|                   | `shdr-coordinator-version`  | Git ref of the SHDR Coordinator image to install                | string  | *(matches feature version)* |\n|                   | `opcua-coordinator-version` | Git ref of the OPC UA Coordinator image to install              | string  | *(matches feature version)* |\n|                   | `opcua-gateway-version`     | Git ref of the OPC UA Gateway image to install                  | string  | *(matches feature version)* |\n|                   | `useLocalSdk`               | Use the local SDK source code instead of installing from GitHub | boolean | `false`                     |\n| `nfs-server`      | `nfs-mountpoint`            | Path exported by the mocked NFS server                          | string  | `/ofa/nfsvolume`            |\n|                   | `nfs-uid`                   | UID owning the exported NFS mountpoint                          | string  | `1200`                      |\n|                   | `nfs-gid`                   | GID owning the exported NFS mountpoint                          | string  | `1200`                      |\n\n---\n\n## ✅ What the SDK Features Do\n\n**Infrastructure (`infra`) Feature:**\n\n* Install OpenFactory Core and SDK (matching the feature version)\n* Deploy Kafka cluster and ksqlDB using Docker Compose\n* Set environment variables:\n\n  ```bash\n  CONTAINER_IP=\u003cDEV_CONTAINER-IP\u003e\n  KAFKA_BROKER=$CONTAINER_IP:9092,broker:29092\n  KSQLDB_URL=http://$CONTAINER_IP:8088\n  OPENFACTORY_VERSION=\u003cvalue of feature option id openfactory-version\u003e\n  ```\n* Add aliases:\n\n  ```bash\n  ksql      – launch the ksqlDB CLI\n  spinup    – start infrastructure\n  teardown  – stop infrastructure\n  ```\n\n**Connectors (`connectors`) Feature:**\n\n* Copy OpenFactory Connector configuration files into the container\n* Set environment variables:\n\n  ```bash\n  OPCUA_GATEWAY_VERSION=\"\u003cversion\u003e\"\n  OPCUA_COORDINATOR_VERSION=\"\u003cversion\u003e\"\n  SHDR_GATEWAY_VERSION=\"\u003cversion\u003e\"\n  SHDR_COORDINATOR_VERSION=\"\u003cversion\u003e\"\n  ```\n* Add aliases:\n\n  ```bash\n  shdr-connector-up     # Launch the SHDR Connector\n  shdr-connector-down   # Stop the SHDR Connector\n  opcua-connector-up    # Launch the OPC UA Connector\n  opcua-connector-down  # Stop the OPC UA Connector\n  ```\n\n**Mocked NFS Server (`nfs-server`) Feature:**\n\n* Install helper scripts to manage a mocked NFS server\n* Create a mocked NFS server container using Docker\n* Create a persistent Docker volume for NFS data\n* Set environment variables:\n\n  ```bash\n  NFS_CONTAINER_NAME=devcontainer-nfs\n  NFS_VOLUME_NAME=devcontainer-nfsdata\n  NFS_NETWORK_NAME=factory-net\n\n  NFS_MOUNTPOINT=\u003cvalue of feature option id nfs-mountpoint\u003e\n  NFS_UID=\u003cvalue of feature option id nfs-uid\u003e\n  NFS_GID=\u003cvalue of feature option id nfs-gid\u003e\n  ```\n* Add aliases:\n\n  ```bash\n  nfs-start  – start mocked NFS server\n  nfs-stop   – stop mocked NFS server\n  ```\n\nAll environment variables and aliases are available in every Bash terminal inside the Dev Container.\n\n---\n\n## 📦 Use Cases\n\n* [Test an OpenFactory adapter](doc/test_adapter.md)\n* Develop OpenFactory applications without a full production infrastructure\n* Experiment with OpenFactory Connectors in isolation or alongside the simulated infrastructure\n\n---\n\n## 🧪 For Feature Developers\n\nIf you're contributing to the SDK itself or developing Dev Container features, you may want to install the SDK from the local source in **editable mode**.\n\n```json\n{\n  \"features\": {\n    \"ghcr.io/openfactoryio/openfactory-sdk/\u003cfeature\u003e:latest\": {\n      \"useLocalSdk\": true\n    }\n  },\n  \"postCreateCommand\": \"pip install -e /workspaces/openfactory-sdk\"\n}\n```\n\n\u003e ⚠️ The local SDK path (`/workspaces/openfactory-sdk`) is only available **after** the container starts — so editable installs must happen via `postCreateCommand` or `postStartCommand`, not inside the feature itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfactoryio%2Fopenfactory-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfactoryio%2Fopenfactory-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfactoryio%2Fopenfactory-sdk/lists"}