mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
NOISSUE - Remove docker (#67)
* Remove Docker-related build functionality Removed the Docker build scripts, Dockerfile, and docker-compose definitions from the Makefile and relevant directories. Updated documentation by stripping out references to building and running Docker containers. This change likely reflects a shift towards a different deployment strategy or a move away from Docker as a dependency for builds and runtime. This simplification could lead to less complexity in the build process and reduce maintenance overhead associated with Docker configurations. Signed-off-by: SammyOina <sammyoina@gmail.com> * Removed Docker image build and publish workflow The workflow for building and publishing a Docker image on pushes to the main branch has been removed. This step likely reflects a change in deployment strategy or a move to a different CI/CD pipeline. Continuous deployment might now be managed by another service or process, adhering to updated operational requirements or infrastructure changes. Signed-off-by: SammyOina <sammyoina@gmail.com> --------- Signed-off-by: SammyOina <sammyoina@gmail.com>
This commit is contained in:
committed by
GitHub
parent
55c19ca6b5
commit
f2567830b3
@@ -1,41 +0,0 @@
|
||||
# Copyright (c) Ultraviolet
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
name: Create and publish a Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Manager and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
push: true
|
||||
build-args: |
|
||||
SVC=manager
|
||||
tags: ghcr.io/ultravioletrs/cocos/manager:latest
|
||||
@@ -7,11 +7,6 @@ COMMIT ?= $(shell git rev-parse HEAD)
|
||||
TIME ?= $(shell date +%F_%T)
|
||||
CLI_SOURCE = ./cmd/cli/main.go
|
||||
CLI_BIN = ${BUILD_DIR}/cocos-cli
|
||||
DOCKERS = $(addprefix docker_,$(SERVICES))
|
||||
DOCKERS_DEV = $(addprefix docker_dev_,$(SERVICES))
|
||||
COCOS_DOCKER_IMAGE_NAME_PREFIX=ghcr.io/ultravioletrs/cocos/
|
||||
|
||||
USER_REPO ?= $(shell git remote get-url origin | sed -e 's/.*\/\([^/]*\)\/\([^/]*\).*/\1_\2/' )
|
||||
empty:=
|
||||
space:= $(empty) $(empty)
|
||||
|
||||
@@ -24,44 +19,10 @@ define compile_service
|
||||
-o ${BUILD_DIR}/cocos-$(1) cmd/$(1)/main.go
|
||||
endef
|
||||
|
||||
define make_docker
|
||||
$(eval svc=$(subst docker_,,$(1)))
|
||||
|
||||
docker build \
|
||||
--no-cache \
|
||||
--build-arg SVC=$(svc) \
|
||||
--build-arg GOARCH=$(GOARCH) \
|
||||
--build-arg GOARM=$(GOARM) \
|
||||
--build-arg VERSION=$(VERSION) \
|
||||
--build-arg COMMIT=$(COMMIT) \
|
||||
--build-arg TIME=$(TIME) \
|
||||
--tag=$(COCOS_DOCKER_IMAGE_NAME_PREFIX)$(svc) \
|
||||
-f docker/Dockerfile .
|
||||
endef
|
||||
|
||||
define make_docker_dev
|
||||
$(eval svc=$(subst docker_dev_,,$(1)))
|
||||
|
||||
docker build \
|
||||
--no-cache \
|
||||
--build-arg SVC=$(svc) \
|
||||
--tag=$(COCOS_DOCKER_IMAGE_NAME_PREFIX)$(svc) \
|
||||
-f docker/Dockerfile.dev ./build
|
||||
endef
|
||||
|
||||
.PHONY: all $(SERVICES) dockers dockers_dev
|
||||
.PHONY: all $(SERVICES)
|
||||
|
||||
all: $(SERVICES)
|
||||
|
||||
$(DOCKERS):
|
||||
$(call make_docker,$(@),$(GOARCH))
|
||||
|
||||
$(DOCKERS_DEV):
|
||||
$(call make_docker_dev,$(@))
|
||||
|
||||
dockers: $(DOCKERS)
|
||||
dockers_dev: $(DOCKERS_DEV)
|
||||
|
||||
$(SERVICES):
|
||||
$(call compile_service,$(@))
|
||||
|
||||
@@ -72,6 +33,3 @@ install-cli: cli
|
||||
protoc:
|
||||
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative agent/agent.proto
|
||||
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative manager/manager.proto
|
||||
|
||||
run:
|
||||
docker compose -f docker/docker-compose.yml -p cocos up
|
||||
|
||||
@@ -12,32 +12,6 @@ Data is always encrypted, protected by hardware secure enclaves (Trusted Executi
|
||||
attested via secure remote attestation protocols, and invisible to cloud processors or any other
|
||||
3rd party to which computation is offloaded.
|
||||
|
||||
## Install
|
||||
The following prerequisites are needed to run Cocos:
|
||||
|
||||
- [Docker](https://docs.docker.com/install/)
|
||||
- [Docker compose](https://docs.docker.com/compose/install/)
|
||||
|
||||
### Build Docker Images
|
||||
Currenty, there is no Docker registry, so Cocos images must be built by hand:
|
||||
```
|
||||
make dockers
|
||||
```
|
||||
|
||||
For this you might be needing to setup DNS servers in your `/etc/resolf.conf` as explained
|
||||
[here](https://github.com/docker/cli/issues/2618) (i.e. add Google's `nameserver 8.8.8.8`).
|
||||
|
||||
### Run Composition
|
||||
|
||||
Once the images are built (`docker images` command should show you `ghcr.io/ultravioletrs/cocos/manager`),
|
||||
composition can be run:
|
||||
|
||||
```bash
|
||||
make run
|
||||
```
|
||||
|
||||
This will bring up the Cocos docker services and interconnect them.
|
||||
|
||||
## Usage
|
||||
|
||||
The quickest way to start using Cocos is via the CLI. The latest version can be downloaded from the [official releases page][rel].
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
FROM golang:1.21-alpine AS builder
|
||||
ARG SVC
|
||||
ARG GOARCH
|
||||
ARG GOARM
|
||||
ARG VERSION
|
||||
ARG COMMIT
|
||||
ARG TIME
|
||||
|
||||
WORKDIR /go/src/github.com/ultravioletrs/cocos-ai
|
||||
COPY . .
|
||||
RUN apk update \
|
||||
&& apk add make \
|
||||
&& make $SVC \
|
||||
&& mv build/cocos-$SVC /exe
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk add qemu-system-x86_64
|
||||
COPY --from=builder /exe /
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
ENTRYPOINT ["/exe"]
|
||||
@@ -1,7 +0,0 @@
|
||||
FROM alpine:latest
|
||||
ARG SVC
|
||||
RUN apk add --no-cache qemu-system-x86_64
|
||||
COPY cocos-$SVC /exe
|
||||
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
|
||||
ENTRYPOINT ["/exe"]
|
||||
@@ -1,36 +0,0 @@
|
||||
version: "3.7"
|
||||
name: "cocos"
|
||||
|
||||
networks:
|
||||
cocos-base-net:
|
||||
driver: bridge
|
||||
|
||||
services:
|
||||
jaeger:
|
||||
image: jaegertracing/all-in-one:1.38.0
|
||||
container_name: cocos-jaeger
|
||||
ports:
|
||||
- ${COCOS_JAEGER_PORT}:${COCOS_JAEGER_PORT}/udp
|
||||
- ${COCOS_JAEGER_FRONTEND}:${COCOS_JAEGER_FRONTEND}
|
||||
- ${COCOS_JAEGER_COLLECTOR}:${COCOS_JAEGER_COLLECTOR}
|
||||
- ${COCOS_JAEGER_CONFIGS}:${COCOS_JAEGER_CONFIGS}
|
||||
networks:
|
||||
- cocos-base-net
|
||||
cocos-manager:
|
||||
image: ghcr.io/ultravioletrs/cocos/manager:latest
|
||||
container_name: cocos-manager
|
||||
env_file:
|
||||
- .env
|
||||
devices:
|
||||
- /dev/kvm
|
||||
volumes:
|
||||
- ../cmd/manager/img:/img
|
||||
- /usr/share/edk2/x64/OVMF_CODE.fd:/usr/share/OVMF/OVMF_CODE.fd
|
||||
- /usr/share/edk2/x64/OVMF_VARS.fd:/usr/share/OVMF/OVMF_VARS.fd
|
||||
depends_on:
|
||||
- jaeger
|
||||
networks:
|
||||
- cocos-base-net
|
||||
ports:
|
||||
- ${MANAGER_HTTP_PORT}:${MANAGER_HTTP_PORT}
|
||||
- ${MANAGER_GRPC_PORT}:${MANAGER_GRPC_PORT}
|
||||
@@ -150,8 +150,6 @@ NB: we set environment variables that we will use in the shell process where we
|
||||
|
||||
## Deployment
|
||||
|
||||
### Standalone
|
||||
|
||||
To start the service outside of the container, execute the following shell script:
|
||||
|
||||
```bash
|
||||
@@ -183,23 +181,6 @@ MANAGER_QEMU_SEV_CBITPOS=51 \
|
||||
./build/cocos-manager
|
||||
```
|
||||
|
||||
|
||||
### Docker
|
||||
```bash
|
||||
go get github.com/ultravioletrs/cocos
|
||||
|
||||
cd $GOPATH/src/github.com/ultravioletrs/cocos
|
||||
|
||||
# compile the manager
|
||||
make manager
|
||||
|
||||
# create manager docker image
|
||||
make docker_dev_manager
|
||||
|
||||
# start docker composition
|
||||
make run
|
||||
```
|
||||
|
||||
### Create QEMU virtual machine (VM)
|
||||
|
||||
To create an instance of VM and run a computation, run
|
||||
|
||||
Reference in New Issue
Block a user