Skip to content

Commit

Permalink
chore/fixup: fix a few more leftovers from the repo rename
Browse files Browse the repository at this point in the history
  • Loading branch information
bojidar-bg committed Dec 26, 2023
1 parent e052014 commit 2fb1625
Show file tree
Hide file tree
Showing 24 changed files with 74 additions and 74 deletions.
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "trusted-pods",
"name": "apocryph",
"version": "0.1.0",
"description": "Trusted Pods is a decentralized compute marketplace where developers can run container pods securely and confidentially through small and medium cloud providers.",
"description": "Apocryph / Trusted Pods is a decentralized compute marketplace where developers can run container pods securely and confidentially through small and medium cloud providers.",
"main": "index.js",
"directories": {
"test": "test"
Expand Down
2 changes: 1 addition & 1 deletion pkg/abi-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "trusted-pods-abi-ts",
"name": "apocryph-abi-ts",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ipfs-ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export { createLibp2pConnectTransport, AllowConnectionGater }
export function connectTo(
node: Helia,
peerAddr: PeerId | Multiaddr | Multiaddr[],
protocol: string = '/x/trusted-pods/provision-pod/0.0.1'
protocol: string
): Transport {
return createLibp2pConnectTransport({
dialStream: async () => await node.libp2p.dialProtocol(peerAddr, protocol),
Expand Down
2 changes: 1 addition & 1 deletion pkg/ipfs-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "trusted-pods-ipfs-ts",
"name": "apocryph-ipfs-ts",
"private": true,
"type": "module",
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions pkg/kubernetes/namespaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
)

const (
LabelTrustedPodsNamespace string = "coop.comrade/trusted-pods-namespace"
AnnotationsTrustedPodsPaymentChannel string = "coop.comrade/trusted-pods-payment-contract"
LabelIpfsP2P string = "coop.comrade/trusted-pods-p2p-helper"
AnnotationsIpfsP2P string = "coop.comrade/trusted-pods-p2p-helper"
LabelTrustedPodsNamespace string = "coop.comrade/apocryph-namespace"
AnnotationsTrustedPodsPaymentChannel string = "coop.comrade/apocryph-payment-contract"
LabelIpfsP2P string = "coop.comrade/apocryph-p2p-helper"
AnnotationsIpfsP2P string = "coop.comrade/apocryph-p2p-helper"
)

var TrustedPodsNamespaceFilter = client.HasLabels{LabelTrustedPodsNamespace}
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "trusted-pods-proto-ts",
"name": "apocryph-proto-ts",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto-ts/protonames.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-3.0

export const provisionPodProtocolName = '/x/trusted-pods/provision-pod/0.0.1'
export const provisionPodProtocolName = '/x/apocryph/provision-pod/0.0.1'
6 changes: 3 additions & 3 deletions pkg/proto/protonames.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

package proto

var ProvisionPod string = "/x/trusted-pods/provision-pod/0.0.1"
var Attest string = "/x/trusted-pods/attest/0.0.1"
var ProvisioningCapacity string = "/x/trusted-pods/provisioning-capacity/0.0.1"
var ProvisionPod string = "/x/apocryph/provision-pod/0.0.1"
var Attest string = "/x/apocryph/attest/0.0.1"
var ProvisioningCapacity string = "/x/apocryph/provisioning-capacity/0.0.1"
8 changes: 4 additions & 4 deletions spec/PROTOCOL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

(Document status: barebones)

When the Publisher Client connects to the Provider Client, it makes use of a libp2p connection; likely through the IPFS DHT, unless the Provider has advertised a stable IP earlier. These connections use the protocols `/trusted-pods/attest/0.0.1`, `/trusted-pods/provisioning-capacity/0.0.1`, and `/trusted-pods/provision-pod/0.0.1`, which is based on a Protobufs protocol defined in the [`:/proto/`](../proto) folder.
When the Publisher Client connects to the Provider Client, it makes use of a libp2p connection; likely through the IPFS DHT, unless the Provider has advertised a stable IP earlier. These connections use the protocols `/apocryph/attest/0.0.1`, `/apocryph/provisioning-capacity/0.0.1`, and `/apocryph/provision-pod/0.0.1`, which is based on a Protobufs protocol defined in the [`:/proto/`](../proto) folder.

The basic structure of this protocol is the following:

1. The Publisher requests an attestation from the Provider using the `/trusted-pods/attest/0.0.1` libp2p protocol.
1. The Publisher requests an attestation from the Provider using the `/apocryph/attest/0.0.1` libp2p protocol.
2. The Provider replies with an attestation (and optionally, the resource capacity available), proving that the whole Provider stack (including the endpoint of the current stream) is running inside a TEE which is trusted by the Publisher.

3. Optionally, the Publisher inquires about the resources that will be requested, using `/trusted-pods/provisioning-capacity/0.0.1`. Resource requirements can include amounts of CPU cores, RAM memory, GPU presence, specific CPU models, and even certain numbers of external IPs available.
3. Optionally, the Publisher inquires about the resources that will be requested, using `/apocryph/provisioning-capacity/0.0.1`. Resource requirements can include amounts of CPU cores, RAM memory, GPU presence, specific CPU models, and even certain numbers of external IPs available.
4. Optionally, the Provider replies with the resources that would be offered / that are available; along with the prices (and payment address) at which the Provider is willing to offer those.

5. The Publisher sends a message that includes the on-wire Manifest and payment channel information using `/trusted-pods/provision-pod/0.0.1`.
5. The Publisher sends a message that includes the on-wire Manifest and payment channel information using `/apocryph/provision-pod/0.0.1`.
6. The Provider provisions the requested services, and replies with a status message

## Manifest wire format
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/constellation/ipfs/ipfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
- name: IPFS_PROFILE
value:
- name: p2p-helper
image: ghcr.io/comrade-coop/trusted-pods/p2p-helper:master
image: ghcr.io/comrade-coop/apocryph/p2p-helper:master
command: ["ipfs-p2p-helper", "run", "--ipfs", "/ip4/127.0.0.1/tcp/5001"]
volumes:
- name: init-scripts
Expand Down Expand Up @@ -117,6 +117,6 @@ spec:
# spec:
# containers:
# - name: p2p-helper
# image: host.minikube.internal:5000/comradecoop/trusted-pods/p2p-helper
# image: host.minikube.internal:5000/comradecoop/apocryph/p2p-helper
# command: ["ipfs-p2p-helper", "run", "--ipfs", "/dns4/ipfs-rpc.ipfs.svc.cluster.local/tcp/5001"]
# serviceAccountName: ipfs-p2p-serviceaccount
10 changes: 5 additions & 5 deletions test/e2e/constellation/trustedpods/tpodserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
namespace: trustedpods
labels:
app: tpodserver
coop.comrade/trusted-pods-p2p-helper: "true"
coop.comrade/apocryph-p2p-helper: "true"
annotations:
coop.comrade/trusted-pods-p2p-helper: "/x/trusted-pods/provision-pod/0.0.1"
coop.comrade/apocryph-p2p-helper: "/x/apocryph/provision-pod/0.0.1"

spec:
ports:
Expand Down Expand Up @@ -65,7 +65,7 @@ spec:
spec:
containers:
- name: register
image: ghcr.io/comrade-coop/trusted-pods/server:master
image: ghcr.io/comrade-coop/apocryph/server:master
command: [
"tpodserver", "registry", "register",
"--config", "config.yaml",
Expand Down Expand Up @@ -106,7 +106,7 @@ spec:
spec:
containers:
- name: tpodserver
image: ghcr.io/comrade-coop/trusted-pods/server:master
image: ghcr.io/comrade-coop/apocryph/server:master
command: [
"tpodserver", "listen",
"--address", "0.0.0.0:8080",
Expand All @@ -124,7 +124,7 @@ spec:
subPath: config.yaml
readOnly: true
- name: tpodmonitor
image: ghcr.io/comrade-coop/trusted-pods/server:master
image: ghcr.io/comrade-coop/apocryph/server:master
command: [
"tpodserver", "monitor",
"--config", "config.yaml",
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/minikube/ipfs/ipfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
- name: IPFS_PROFILE
value:
- name: p2p-helper
image: host.minikube.internal:5000/comradecoop/trusted-pods/p2p-helper
image: host.minikube.internal:5000/comradecoop/apocryph/p2p-helper
command: ["ipfs-p2p-helper", "run", "--ipfs", "/ip4/127.0.0.1/tcp/5001"]
volumes:
- name: init-scripts
Expand Down Expand Up @@ -124,6 +124,6 @@ spec:
# spec:
# containers:
# - name: p2p-helper
# image: host.minikube.internal:5000/comradecoop/trusted-pods/p2p-helper
# image: host.minikube.internal:5000/comradecoop/apocryph/p2p-helper
# command: ["ipfs-p2p-helper", "run", "--ipfs", "/dns4/ipfs-rpc.ipfs.svc.cluster.local/tcp/5001"]
# serviceAccountName: ipfs-p2p-serviceaccount
12 changes: 6 additions & 6 deletions test/e2e/minikube/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ set -v

## 0.1: Build/tag server and p2p-helper images

docker build -t comradecoop/trusted-pods/server:latest ../../.. --target server
docker build -t comradecoop/apocryph/server:latest ../../.. --target server

docker build -t comradecoop/trusted-pods/p2p-helper:latest ../../.. --target p2p-helper
docker build -t comradecoop/apocryph/p2p-helper:latest ../../.. --target p2p-helper

## 0.2: Create local registry and push server and p2p-helper images

docker run -d -p 5000:5000 --restart=always --name registry registry:2 || echo "Docker registry already running"

docker tag comradecoop/trusted-pods/server:latest localhost:5000/comradecoop/trusted-pods/server:latest
docker push localhost:5000/comradecoop/trusted-pods/server:latest
docker tag comradecoop/apocryph/server:latest localhost:5000/comradecoop/apocryph/server:latest
docker push localhost:5000/comradecoop/apocryph/server:latest

docker tag comradecoop/trusted-pods/p2p-helper:latest localhost:5000/comradecoop/trusted-pods/p2p-helper:latest
docker push localhost:5000/comradecoop/trusted-pods/p2p-helper:latest
docker tag comradecoop/apocryph/p2p-helper:latest localhost:5000/comradecoop/apocryph/p2p-helper:latest
docker push localhost:5000/comradecoop/apocryph/p2p-helper:latest

## 0.3: Set up a local ethereum node and deploy contracts to it

Expand Down
10 changes: 5 additions & 5 deletions test/e2e/minikube/trustedpods/tpodserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ metadata:
namespace: trustedpods
labels:
app: tpodserver
coop.comrade/trusted-pods-p2p-helper: "true"
coop.comrade/apocryph-p2p-helper: "true"
annotations:
coop.comrade/trusted-pods-p2p-helper: "/x/trusted-pods/provision-pod/0.0.1"
coop.comrade/apocryph-p2p-helper: "/x/apocryph/provision-pod/0.0.1"

spec:
ports:
Expand Down Expand Up @@ -65,7 +65,7 @@ spec:
spec:
containers:
- name: register
image: host.minikube.internal:5000/comradecoop/trusted-pods/server
image: host.minikube.internal:5000/comradecoop/apocryph/server
command: [
"tpodserver", "registry", "register",
"--config", "config.yaml",
Expand Down Expand Up @@ -106,7 +106,7 @@ spec:
spec:
containers:
- name: tpodserver
image: host.minikube.internal:5000/comradecoop/trusted-pods/server
image: host.minikube.internal:5000/comradecoop/apocryph/server
command: [
"tpodserver", "listen",
"--address", "0.0.0.0:8080",
Expand All @@ -124,7 +124,7 @@ spec:
subPath: config.yaml
readOnly: true
- name: tpodmonitor
image: host.minikube.internal:5000/comradecoop/trusted-pods/server
image: host.minikube.internal:5000/comradecoop/apocryph/server
command: [
"tpodserver", "monitor",
"--config", "config.yaml",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/webui/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "trusted-pods-webui",
"name": "apocryph-webui",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/webui/src/connections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { createPublicClient, createWalletClient, http } from 'viem'
import { foundry } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'
import { createClient } from 'trusted-pods-ipfs-ts'
import { createClient } from 'apocryph-ipfs-ts'

export const publicClient = createPublicClient({
chain: foundry,
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/webui/src/fund.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0

import './style.css'
import { paymentABI, ierc20ABI, mockTokenABI } from 'trusted-pods-abi-ts'
import { paymentABI, ierc20ABI, mockTokenABI } from 'apocryph-abi-ts'
import { bytesToHex } from 'viem'
import { publicClient, walletClient } from './connections'

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/webui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ProviderConfig,
Pod,
PaymentChannelConfig
} from 'trusted-pods-proto-ts'
} from 'apocryph-proto-ts'
import { fundPaymentChannel } from './fund'
import { provisionPod } from './provision'
import { bytesToHex, hexToBytes } from 'viem'
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/webui/src/provision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import {
Hex
} from 'viem'
import { heliaNodePromise, walletClient } from './connections'
import { connectTo } from 'trusted-pods-ipfs-ts'
import { connectTo } from 'apocryph-ipfs-ts'
import { multiaddr } from '@multiformats/multiaddr'
import { createPromiseClient } from '@connectrpc/connect'
import {
Pod,
ProvisionPodResponse,
ProvisionPodService,
provisionPodProtocolName
} from 'trusted-pods-proto-ts'
} from 'apocryph-proto-ts'
import { PartialMessage } from '@bufbuild/protobuf'

// Copied and adapted from pkg/publisher/connect.go
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/webui/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
ProviderConfig,
Pod,
PaymentChannelConfig
} from 'trusted-pods-proto-ts'
} from 'apocryph-proto-ts'
import type { PartialMessage } from '@bufbuild/protobuf'
import { hexToBytes } from 'viem'

Expand Down
Loading

0 comments on commit 2fb1625

Please sign in to comment.