Skip to content

comrade-coop/apocryph

Repository files navigation

Apocryph / Trusted Pods

NOTE: This repository used to host the code recently moved to https://github.com/comrade-coop/apocryph-chain as part of a repository overhaul and reorganization. With due apologies to any past Github stargazers, we hope they would find this new and more active project well worth their star.

Meanwhile, the main body of code was moved here from https://github.com/comrade-coop/trusted-pods (now gone), and parts of the documentation/code might still refer to the old location. Use git remote set-url origin git://github.com/comrade-coop/apocryph (or git remote set-url origin git@github.com:comrade-coop/apocryph.git) to update your local clone/s to point to the right repository.

See this issue for more details.


Apocryph is a decentralised three-sided compute marketplace, allowing end-users to deploy their own personal instance of "cloud" software and developers to train AI/ML models or deploy arbitrary software applications to pre-verified machines in the marketplace. All programs would run inside a secure computing enclave that no one else can access (using TEE technology) for a modest fee (however much the machine provider charges; it's a marketplace) and with regular uptime and data storage SLAs; "cloud" software developers are being rewarded for providing the software (essentially use cases) to the marketplace with a fraction of the fees generated by the instances of their software.

Discord

📓 For more information you can check our documentation (specs) draft:

Spinning up a local testing environment

Note The following tests have been conducted on Linux.

Dependencies

Before running the various tests, Make sure the following dependencies are installed and available in your PATH:

  • curl: A command-line tool for transferring data with URL syntax.
  • xargs: A command that builds and executes command lines from standard input.
  • sed: A stream editor for filtering and transforming text.
  • go: The Go programming language compiler.
  • protoc: The protocol buffer compiler, protoc, is used to compile .proto files, which contain service and message definitions.
  • protoc-gen-go: tool used in conjunction with protobuf to generate Go code from protobuf definition files
  • protoc-gen-connect-go: go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
  • abigen: convert Ethereum ABI definitions into easy to use, type-safe Go packages. go install github.com/ethereum/go-ethereum/cmd/abigen@latest
  • turbo: Incremental bundler and build system
  • kubectl: The Kubernetes command-line tool for managing Kubernetes clusters.
  • docker: A platform for developing, shipping, and running applications using containerization.
  • jq: A lightweight and flexible command-line JSON processor.
  • minikube: A tool that runs a single-node Kubernetes cluster on your personal computer (locally).
  • helm: The package manager for Kubernetes
  • helmfile: A declarative configuration tool for Helm.
  • forge, cast, anvil: tools for building Ethereum-based applications.
  • ipfs: The InterPlanetary File System
  • constellation: Constellation is a Kubernetes engine that provides a secure and confidential way to run Kubernetes clusters. (Needed in test/e2e/constellation).

To start a local environment for e.g. integration-testing or evaluating the project, you can use the end-to-end tests in the test/e2e folder.

Typical development involves running the minikube end-to-end test, which can be done using the following command:

npm i
turbo sync
./test/e2e/minikube/run-test.sh

The command, all dependencies are met, will proceed to start a local docker registry and test ethereum node, build and upload the project to them, then spin up a minikube cluster and deploy all necessary prerequisites into it, and finally deploying a pod from a manifest file into the cluster and then querying it over HTTP. It should display the curl command used to query the pod, and you should be able to use it yourself after the script is finished.

In addition, once you have started the minikube end-to-end test, you can also run the web UI test, which presents a sample interface that publishers can use to deploy a predefined pod template onto the minikube cluster / provider directly from their web browser.

turbo dev

Once you are done playing around with the tests, simply run the following command to delete and stop the minikube cluster:

test/e2e/minikube/run-test.sh teardown

(or alternatively, pass teardown full to also stop any local docker containers used by the test)

Development

Install Turbo (If you haven't already) using your favorite package manager , Ex: npm i -g turbo

Syncing Generated Files

After editing files in proto/ or contracts/, run the following command to sync the generated files:

turbo sync

Build Images

The following will build the apocryph trusted pods server and the p2p-helper images

turbo build-images

Contributing

As it is, this project is still in its infancy, and most non-trivial contributions should be done only after discussing them with the team -- or else risk missing the point. So, if you fancy contributing to the project, please feel free to hop on our Discord server or just open/reply to an issue discussing your concrete ideas for contribution.

Also, see the PUBLISHING.md documentation for more details on the overall structure of the project.

License

SPDX-License-Identifier: GPL-3.0

About

A decentralized compute marketplace for running pods securely and confidentially

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •