Skip to content

Commit

Permalink
remove: Skynet references
Browse files Browse the repository at this point in the history
Signed-off-by: jay-dee7 <me@jsdp.dev>
  • Loading branch information
jay-dee7 committed Oct 22, 2023
1 parent 808cc1a commit dff53ae
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The specification provides similar capabilities as that of the Docker Registry H
## Why OpenRegistry?
For the longest time, we have relied on DockerHub to host and distribute our container images (both private and public). OpenRegistry tries to provide a decentralized alternative to that by running a community driven container registry, for People by People.

OpenRegitry uses AkashNetwork as it's compute layer and SkyNet for storage. Since AkashNetwork provides a spot like compute market, fault tolerance, Scalability and Resiliency are our priorities from day one.
OpenRegitry uses [Akash Network](https://akash.network) as it's compute layer and IPFS, Filebase, or Storj for storage. Since AkashNetwork provides a spot like compute market, fault tolerance, Scalability and Resiliency are our priorities from day one.

## Getting Started
Working with OpenRegistry is no different than working with any other container registry. Following are the steps to get started:
Expand Down
1 change: 0 additions & 1 deletion config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ registry:
services:
- github
- token
- skynet_homescreen
auth:
enabled: false
priv_key: .certs/registry.local
Expand Down
8 changes: 0 additions & 8 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

type (
OpenRegistryConfig struct {
SkynetConfig Skynet `yaml:"skynet" mapstructure:"skynet" validate:"-"`
WebAppConfig WebAppConfig `yaml:"web_app" mapstructure:"web_app"`
OAuth OAuth `yaml:"oauth" mapstructure:"oauth" validate:"-"`
StoreConfig Store `yaml:"database" mapstructure:"database" validate:"required"`
Expand Down Expand Up @@ -88,13 +87,6 @@ type (
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
}

Skynet struct {
SkynetPortalURL string `yaml:"portal_url" mapstructure:"portal_url" validate:"-"`
EndpointPath string `yaml:"endpoint_path" mapstructure:"endpoint_path"`
ApiKey string `yaml:"api_key" mapstructure:"api_key"`
CustomUserAgent string `yaml:"custom_user_agent" mapstructure:"custom_user_agent"`
}

Log struct {
Service string `yaml:"name" mapstructure:"name"`
Endpoint string `yaml:"endpoint" mapstructure:"endpoint"`
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/000002_create_blob_table.up.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE "blob" (
"uuid" uuid,
"digest" text PRIMARY KEY,
"sky_link" text,
"dfs_link" text,
"start_range" int,
"end_range" int,
"created_at" timestamp,
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/000003_create_layer_table.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE "layer" (
"digest" text UNIQUE NOT NULL,
"blob_ids" text[],
"media_type" text,
"sky_link" text,
"dfs_link" text,
"size" int,
"created_at" timestamp,
"updated_at" timestamp
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/000004_create_config_table.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE "config" (
"namespace" text NOT NULL,
"reference" text NOT NULL,
"digest" text NOT NULL,
"sky_link" text,
"dfs_link" text,
"media_type" text,
"layers" text[],
"size" int,
Expand Down
2 changes: 1 addition & 1 deletion db/migrations/000013_create_repository_table.up.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE "repositori" (
"uuid" uuid,
"digest" text PRIMARY KEY,
"sky_link" text,
"dfs_link" text,
"start_range" int,
"end_range" int,
"created_at" timestamp
Expand Down
7 changes: 3 additions & 4 deletions dfs/dfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import (
"context"
"io"

"github.com/SkynetLabs/go-skynet/v2"
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/containerish/OpenRegistry/config"
"github.com/containerish/OpenRegistry/types"
"github.com/containerish/OpenRegistry/store/v2/types"
)

type DFS interface {
Expand All @@ -34,10 +33,10 @@ type DFS interface {
completedParts []s3types.CompletedPart,
) (string, error)
Download(ctx context.Context, path string) (io.ReadCloser, error)
DownloadDir(skynetLink, dir string) error
DownloadDir(dfsLink, dir string) error
List(path string) ([]*types.Metadata, error)
AddImage(ns string, mf, l map[string][]byte) (string, error)
Metadata(skylink string) (*skynet.Metadata, error)
Metadata(dfsLink string) (*types.ObjectMetadata, error)
GetUploadProgress(identifier, uploadID string) (*types.ObjectMetadata, error)
AbortMultipartUpload(ctx context.Context, layerKey string, uploadId string) error
GeneratePresignedURL(ctx context.Context, key string) (string, error)
Expand Down
11 changes: 5 additions & 6 deletions dfs/filebase/filebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"io"
"time"

"github.com/SkynetLabs/go-skynet/v2"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/containerish/OpenRegistry/config"
"github.com/containerish/OpenRegistry/dfs"
"github.com/containerish/OpenRegistry/types"
"github.com/containerish/OpenRegistry/store/v2/types"
"github.com/opencontainers/go-digest"
)

Expand Down Expand Up @@ -208,7 +207,7 @@ func (fb *filebase) Download(ctx context.Context, path string) (io.ReadCloser, e

return resp.Body, nil
}
func (fb *filebase) DownloadDir(skynetLink, dir string) error {
func (fb *filebase) DownloadDir(dfsLink, dir string) error {
return nil
}
func (fb *filebase) List(path string) ([]*types.Metadata, error) {
Expand All @@ -221,7 +220,7 @@ func (fb *filebase) AddImage(ns string, mf, l map[string][]byte) (string, error)
// Metadata API returns the HEADERS for an object. This object can be a manifest or a layer.
// This API is usually a little behind when it comes to fetching the details for an uploaded object.
// This is why we put it in a retry loop and break it as soon as we get the data
func (fb *filebase) Metadata(identifier string) (*skynet.Metadata, error) {
func (fb *filebase) Metadata(identifier string) (*types.ObjectMetadata, error) {
var resp *s3.HeadObjectOutput
var err error

Expand All @@ -248,10 +247,10 @@ func (fb *filebase) Metadata(identifier string) (*skynet.Metadata, error) {
cid = identifier
}

return &skynet.Metadata{
return &types.ObjectMetadata{
ContentType: *resp.ContentType,
Etag: *resp.ETag,
Skylink: cid,
DFSLink: cid,
ContentLength: int(resp.ContentLength),
}, nil
}
Expand Down
11 changes: 5 additions & 6 deletions dfs/mock/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ import (
"os"
"strings"

skynet "github.com/SkynetLabs/go-skynet/v2"
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/containerish/OpenRegistry/config"
"github.com/containerish/OpenRegistry/dfs"
"github.com/containerish/OpenRegistry/types"
types "github.com/containerish/OpenRegistry/store/v2/types"
"github.com/fatih/color"
"github.com/google/uuid"
"github.com/labstack/echo/v4"
Expand Down Expand Up @@ -126,7 +125,7 @@ func (ms *mockStorage) Download(ctx context.Context, path string) (io.ReadCloser
return fd, nil
}

func (ms *mockStorage) DownloadDir(skynetLink, dir string) error {
func (ms *mockStorage) DownloadDir(dfsLink, dir string) error {
return nil
}

Expand All @@ -138,7 +137,7 @@ func (ms *mockStorage) AddImage(ns string, mf, l map[string][]byte) (string, err
return "", nil
}

func (ms *mockStorage) Metadata(identifier string) (*skynet.Metadata, error) {
func (ms *mockStorage) Metadata(identifier string) (*types.ObjectMetadata, error) {
var (
fd afero.File
err error
Expand All @@ -160,10 +159,10 @@ func (ms *mockStorage) Metadata(identifier string) (*skynet.Metadata, error) {
}
fd.Close()

return &skynet.Metadata{
return &types.ObjectMetadata{
ContentType: "",
Etag: "",
Skylink: identifier,
DFSLink: identifier,
ContentLength: int(stat.Size()),
}, nil

Expand Down
11 changes: 5 additions & 6 deletions dfs/storj/storj.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import (
"io"
"time"

"github.com/SkynetLabs/go-skynet/v2"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/containerish/OpenRegistry/config"
"github.com/containerish/OpenRegistry/dfs"
"github.com/containerish/OpenRegistry/types"
"github.com/containerish/OpenRegistry/store/v2/types"
"github.com/opencontainers/go-digest"
)

Expand Down Expand Up @@ -185,7 +184,7 @@ func (sj *storj) Download(ctx context.Context, path string) (io.ReadCloser, erro
return resp.Body, nil
}

func (sj *storj) DownloadDir(skynetLink, dir string) error {
func (sj *storj) DownloadDir(dfsLink, dir string) error {
return nil
}

Expand All @@ -200,7 +199,7 @@ func (sj *storj) AddImage(ns string, mf, l map[string][]byte) (string, error) {
// Metadata API returns the HEADERS for an object. This object can be a manifest or a layer.
// This API is usually a little behind when it comes to fetching the details for an uploaded object.
// This is why we put it in a retry loop and break it as soon as we get the data
func (sj *storj) Metadata(identifier string) (*skynet.Metadata, error) {
func (sj *storj) Metadata(identifier string) (*types.ObjectMetadata, error) {
var resp *s3.HeadObjectOutput
var err error

Expand All @@ -222,10 +221,10 @@ func (sj *storj) Metadata(identifier string) (*skynet.Metadata, error) {
return nil, fmt.Errorf("ERR_STORJ_METADATA_HEAD: %w", err)
}

return &skynet.Metadata{
return &types.ObjectMetadata{
ContentType: *resp.ContentType,
Etag: *resp.ETag,
Skylink: identifier,
DFSLink: identifier,
ContentLength: int(resp.ContentLength),
}, nil
}
Expand Down
11 changes: 5 additions & 6 deletions dfs/storj/uplink/uplink.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import (
"log"
"time"

"github.com/SkynetLabs/go-skynet/v2"
s3types "github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/containerish/OpenRegistry/config"
"github.com/containerish/OpenRegistry/dfs"
"github.com/containerish/OpenRegistry/types"
"github.com/containerish/OpenRegistry/store/v2/types"
"github.com/fatih/color"
"storj.io/uplink"
"storj.io/uplink/edge"
Expand Down Expand Up @@ -170,14 +169,14 @@ func (u *storjUplink) GetUploadProgress(identifier string, uploadID string) (*ty
}

// Metadata implements dfs.DFS
func (u *storjUplink) Metadata(dfsLink string) (*skynet.Metadata, error) {
func (u *storjUplink) Metadata(dfsLink string) (*types.ObjectMetadata, error) {
metadata, err := u.client.StatObject(context.Background(), u.bucket, dfsLink)
if err != nil {
return nil, err
}

return &skynet.Metadata{
Skylink: metadata.Key,
return &types.ObjectMetadata{
DFSLink: metadata.Key,
ContentLength: int(metadata.System.ContentLength),
}, nil
}
Expand Down Expand Up @@ -252,7 +251,7 @@ func (u *storjUplink) List(path string) ([]*types.Metadata, error) {
}

// DownloadDir implements dfs.DFS
func (u *storjUplink) DownloadDir(skynetLink string, dir string) error {
func (u *storjUplink) DownloadDir(dfsLink string, dir string) error {
panic("unimplemented")
}

Expand Down
1 change: 0 additions & 1 deletion docs/contributing/development-environment-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ registry:
services:
- github
- token
- skynet_homescreen
dfs:
s3_any:
access_key: <access-key>
Expand Down
2 changes: 0 additions & 2 deletions env-vars.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ OPEN_REGISTRY_DOMAIN=beta.openregistry.dev
OPEN_REGISTRY_VERSION="master"
OPEN_REGISTRY_HOST=0.0.0.0
OPEN_REGISTRY_PORT=5000
OPEN_REGISTRY_SKYNET_PORTAL_URL=https://siasky.net
OPEN_REGISTRY_SIGNING_SECRET="<signin-secret-here>"
OPEN_REGISTRY_SUPPORTED_SERVICES=github,token
OPEN_REGISTRY_ENVIRONMENT=local
OPEN_REGISTRY_LOG_SERVICE_NAME=grafana-loki
OPEN_REGISTRY_LOG_SERVICE_HOST=http://0.0.0.0:9880/app.log
OPEN_REGISTRY_LOG_SERVICE_AUTH_KIND=basic
OPEN_REGISTRY_SKYNET_API_KEY="<skynet-jwt-here>"
OPEN_REGISTRY_DB_HOST=0.0.0.0
OPEN_REGISTRY_DB_PORT=5432
OPEN_REGISTRY_DB_USER=postgres
Expand Down
10 changes: 3 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
module github.com/containerish/OpenRegistry

go 1.19
go 1.21

require (
github.com/SkynetLabs/go-skynet/v2 v2.0.2
github.com/alexliesenfeld/health v0.8.0
github.com/aws/aws-sdk-go-v2 v1.21.2
github.com/aws/aws-sdk-go-v2/config v1.19.0
Expand Down Expand Up @@ -56,6 +55,7 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand All @@ -64,8 +64,7 @@ require (
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/tools v0.13.0 // indirect
Expand Down Expand Up @@ -150,7 +149,6 @@ require (
github.com/x448/float16 v0.8.4 // indirect
github.com/zeebo/blake3 v0.2.3 // indirect
github.com/zeebo/errs v1.3.0 // indirect
gitlab.com/NebulousLabs/errors v0.0.0-20171229012116-7ead97ef90b8 // indirect
golang.org/x/net v0.17.0
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
Expand All @@ -163,5 +161,3 @@ require (
storj.io/common v0.0.0-20230920095429-0ce0a575e6f8 // indirect
storj.io/drpc v0.0.33 // indirect
)

replace github.com/SkynetLabs/go-skynet/v2 => github.com/containerish/go-skynet/v2 v2.0.2-0.20220629062209-f31ff192458d
Loading

0 comments on commit dff53ae

Please sign in to comment.