lf-edge / eden

Eden is where EVE and Adam get tried and tested:
https://projecteve.dev
Apache License 2.0
49 stars 47 forks source link

Unable to spawn pod using registry #975

Closed mzampetakis closed 2 months ago

mzampetakis commented 3 months ago

Description

While I am able to start a simple nginx pod using eden, I am unable to start a pod that uses the registry container

Steps to Reproduce

Starting eden using:

make clean
make build-tests
./eden config add default
./eden setup
source ~/.eden/activate.sh
./eden start
./eden status

Current status:

 »  ./eden status

✔ Adam status: container with name eden_adam is running
    Adam is expected at https://192.168.1.12:3333
    For local Adam you can run 'docker logs eden_adam' to see logs
✔ Registry status: container with name eden_registry is running
    Registry is expected at https://192.168.1.12:5050
    For local registry you can run 'docker logs eden_registry' to see logs
✔ Redis status: container with name eden_redis is running
    Redis is expected at 192.168.1.12:6379
    For local Redis you can run 'docker logs eden_redis' to see logs
✔ EServer process status: container with name eden_eserver is running
    EServer is expected at http://192.168.1.12:8888 from EVE
    For local EServer you can run 'docker logs eden_eserver' to see logs

--- context: default ---
EVE state: not onboarded

? EVE status: undefined (no onboarded EVE)
✔ EVE on Qemu status: running with pid 77847
    Logs for local EVE at: /Users/mzampetakis/workspace/go/eden/dist/default-eve.log
✘ EVE Request IP: error: getControllerAndDevFromConfig: GetDeviceCurrent error: no device found
------

Onboard eve:

 ./eden eve onboard
./eden status

Output:

»  ./eden eve onboard 

INFO[0000] Adam waiting for EVE registration (0) of (20)
INFO[0020] Adam waiting for EVE registration (1) of (20)
INFO[0040] Adam waiting for EVE registration (2) of (20)
INFO[0060] Device uuid: 1b9deea2-1e52-4a69-9a90-e5cbad392ab6
config changed, to see config run 'eden controller edge-node get-config'
INFO[0061] onboarded
INFO[0061] device UUID: 1b9deea2-1e52-4a69-9a90-e5cbad392ab6
EDEN-default_--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 » ./eden status

✔ Adam status: container with name eden_adam is running
    Adam is expected at https://192.168.1.12:3333
    For local Adam you can run 'docker logs eden_adam' to see logs
✔ Registry status: container with name eden_registry is running
    Registry is expected at https://192.168.1.12:5050
    For local registry you can run 'docker logs eden_registry' to see logs
✔ Redis status: container with name eden_redis is running
    Redis is expected at 192.168.1.12:6379
    For local Redis you can run 'docker logs eden_redis' to see logs
✔ EServer process status: container with name eden_eserver is running
    EServer is expected at http://192.168.1.12:8888 from EVE
    For local EServer you can run 'docker logs eden_eserver' to see logs

--- context: default ---
EVE state: registered

✔ EVE REMOTE IPs: 192.168.0.10; fe80::21e9:96c4:721b:7e49; 192.168.0.11; fe80::f65a:c75b:226b:af8
    Last info received time: 2024-06-06 09:03:15 +0300 EEST
✔ EVE memory: 0 B/0 B
✔ EVE on Qemu status: running with pid 77847
    Logs for local EVE at: /Users/mzampetakis/workspace/go/eden/dist/default-eve.log
✔ EVE Request IP: 192.168.65.1
------

Spawning a simple (without mount point) nginx pod:

 » ./eden pod deploy --name=eve_nginx docker://nginx -p 8028:80                                                                                                                                      [24-06-06 9:03]
config changed, to see config run 'eden controller edge-node get-config'
INFO[0003] deploy pod eve_nginx with docker://nginx request sent
 » ./eden pod ps 
NAME        IMAGE           UUID                    INTERNAL    EXTERNAL    MEMORY      STATE(ADAM) LAST_STATE(EVE)
eve_nginx   library/nginx:latest    c36a99ed-9c98-4041-bbe6-8a62c7595874    10.11.12.2:80   127.0.0.1:8028  4.0 MB/973 MB   IN_CONFIG   RUNNING

At this point I can access nginx default page from http://localhost:8028.

Actual Results

Trying to spawn a nginx with a mount point fails:

» ./eden pod deploy --name=eve_nginx_mount docker://nginx -p 8029:80 --mount=src=./data/helloeve,dst=/usr/share/nginx/html                                                                     

INFO[0002] will use volume [./data/helloeve] at mount point [/usr/share/nginx/html]
{"stream":"Step 1/2 : FROM scratch"}
{"stream":"\n"}
{"stream":" ---\u003e \n"}
{"stream":"Step 2/2 : COPY . /"}
{"stream":"\n"}
{"stream":" ---\u003e Using cache\n"}
{"stream":" ---\u003e fde1f781966f\n"}
{"aux":{"ID":"sha256:fde1f781966f83de4711727437c082f169475ff9e7071dbb5256fb4c2097cae1"}}
{"stream":"Successfully built fde1f781966f\n"}
{"stream":"Successfully tagged eden/helloeve:ce8ba75a161af519cd3d47af0947f5dfeefe5881fbfab7217559e018ac8e6eae\n"}
FATA[0002] createImageDirectory LoadRegistry: error pushing to 192.168.1.12:5050: PUT http://192.168.1.12:5050/v2/eden/helloeve/manifests/ce8ba75a161af519cd3d47af0947f5dfeefe5881fbfab7217559e018ac8e6eae: MANIFEST_BLOB_UNKNOWN: blob unknown to registry; sha256:c39547ddcdfefb32320f6b661e7b935aef13ba9315e82e4cbf958ca4a4212be4

Logs produced by docker logs eden_registry:

192.168.65.1 - - [06/Jun/2024:06:20:48 +0000] "GET /v2/ HTTP/1.1" 200 2 "" "Go-http-client/1.1"
time="2024-06-06T06:20:48.81816572Z" level=info msg="response completed" go.version=go1.11.2 http.request.host="192.168.1.12:5050" http.request.id=78c4cd98-0892-47ef-8586-d0ce2e5037cf http.request.method=GET http.request.remoteaddr="192.168.65.1:41109" http.request.uri="/v2/" http.request.useragent="Go-http-client/1.1" http.response.contenttype="application/json; charset=utf-8" http.response.duration="380.166µs" http.response.status=200 http.response.written=2
time="2024-06-06T06:20:48.819248886Z" level=info msg="response completed" go.version=go1.11.2 http.request.host="192.168.1.12:5050" http.request.id=b786ac25-d530-4b8b-9328-5e9b73da7228 http.request.method=HEAD http.request.remoteaddr="192.168.65.1:41109" http.request.uri="/v2/eden/helloeve/blobs/sha256:fde1f781966f83de4711727437c082f169475ff9e7071dbb5256fb4c2097cae1" http.request.useragent="go-containerregistry/v0.10.0" http.response.contenttype="application/octet-stream" http.response.duration="736.583µs" http.response.status=200 http.response.written=0
192.168.65.1 - - [06/Jun/2024:06:20:48 +0000] "HEAD /v2/eden/helloeve/blobs/sha256:fde1f781966f83de4711727437c082f169475ff9e7071dbb5256fb4c2097cae1 HTTP/1.1" 200 0 "" "go-containerregistry/v0.10.0"
time="2024-06-06T06:20:48.820535053Z" level=info msg="response completed" go.version=go1.11.2 http.request.host="192.168.1.12:5050" http.request.id=130bf2c2-6f4c-46c6-a365-e9cbebb17807 http.request.method=HEAD http.request.remoteaddr="192.168.65.1:41109" http.request.uri="/v2/eden/helloeve/blobs/sha256:6c51aee7c8d037509211b16b04e15f4480aeee0e57abee57b8c1a7b6c31921da" http.request.useragent="go-containerregistry/v0.10.0" http.response.contenttype="application/octet-stream" http.response.duration="759.959µs" http.response.status=200 http.response.written=0
192.168.65.1 - - [06/Jun/2024:06:20:48 +0000] "HEAD /v2/eden/helloeve/blobs/sha256:6c51aee7c8d037509211b16b04e15f4480aeee0e57abee57b8c1a7b6c31921da HTTP/1.1" 200 0 "" "go-containerregistry/v0.10.0"
192.168.65.1 - - [06/Jun/2024:06:20:48 +0000] "PUT /v2/eden/helloeve/manifests/ce8ba75a161af519cd3d47af0947f5dfeefe5881fbfab7217559e018ac8e6eae HTTP/1.1" 400 166 "" "go-containerregistry/v0.10.0"
time="2024-06-06T06:20:48.821412136Z" level=error msg="response completed with error" err.code="manifest blob unknown" err.detail=sha256:c39547ddcdfefb32320f6b661e7b935aef13ba9315e82e4cbf958ca4a4212be4 err.message="blob unknown to registry" go.version=go1.11.2 http.request.contenttype="application/vnd.docker.distribution.manifest.v2+json" http.request.host="192.168.1.12:5050" http.request.id=3046b5d6-197a-4dfb-beda-8eadc4c6dc4c http.request.method=PUT http.request.remoteaddr="192.168.65.1:41109" http.request.uri="/v2/eden/helloeve/manifests/ce8ba75a161af519cd3d47af0947f5dfeefe5881fbfab7217559e018ac8e6eae" http.request.useragent="go-containerregistry/v0.10.0" http.response.contenttype="application/json; charset=utf-8" http.response.duration="383.042µs" http.response.status=400 http.response.written=166 vars.name="eden/helloeve" vars.reference=ce8ba75a161af519cd3d47af0947f5dfeefe5881fbfab7217559e018ac8e6eae

Expected Results

I was expecting to create the pod and be able to access nginx server at localhost:8029 port.

Also tried to manually use the registry and it worked successfully:

» docker pull ubuntu 
Using default tag: latest
latest: Pulling from library/ubuntu
aa21f24e1940: Pull complete
Digest: sha256:e3f92abc0967a6c19d0dfa2d55838833e947b9d74edbcb0113e48535ad4be12a
Status: Downloaded newer image for ubuntu:latest
docker.io/library/ubuntu:latest

What's Next?
  1. Sign in to your Docker account → docker login
  2. View a summary of image vulnerabilities and recommendations → docker scout quickview ubuntu
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
~/workspace » docker tag ubuntu localhost:5050/ubuntu
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
~/workspace » docker push localhost:5050/ubuntu
Using default tag: latest
The push refers to repository [localhost:5050/ubuntu]
b5efb8814502: Pushed
latest: digest: sha256:b283574e20ca70f415fdea29e71cb1cd27ee5b7833ff65b9997db5385656a7c7 size: 529

Additional Information

Eden is running from commit #b96434efff1582324520fe359a3252e357e766f5 under:

Model Name: MacBook Pro
Model Identifier:   Mac15,7
Chip:   Apple M3 Pro
Total Number of Cores:  12 (6 performance and 6 efficiency)
Memory: 36 GB
macOS: Sonoma 14.5 (23F79)

» docker --version                                                                                                                                                                                              
Docker version 26.1.1, build 4cf5afa
giggsoff commented 2 months ago

Hi @mzampetakis. Thank you for such detailed explanation! Hope the issue solved by #982. Feel free to re-open it if you still have the problem.

mzampetakis commented 2 months ago

Thanks @giggsoff ! It seems that the issue has beed resolved now.