Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Cleanups/fixes for docker deps and builds #21962

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

phlax
Copy link
Member

@phlax phlax commented Jun 30, 2022

  • Pin all docker image deps
  • Add dependabot monitoring for docker deps
  • Make ports dynamic so examples can be run (by CI) simultaneously
  • Remove unused exposed ports
  • Quieten apt/pip/service logging
  • Make docker-compose bin path configurable
  • Fix Can not build for front-proxy of examples #20915
  • Fix flakey websockets example (hopefully)

Signed-off-by: Ryan Northey [email protected]

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@phlax phlax marked this pull request as draft June 30, 2022 14:46
@phlax phlax force-pushed the examples-hermetic branch 2 times, most recently from d3be17b to 32d790e Compare June 30, 2022 16:51
examples/udp/Dockerfile-udp Outdated Show resolved Hide resolved
@phlax phlax force-pushed the examples-hermetic branch 2 times, most recently from 9b6bb56 to 7269ab7 Compare June 30, 2022 20:52
@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Jun 30, 2022
@repokitteh-read-only
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @wrowe

🐱

Caused by: #21962 was synchronize by phlax.

see: more, trace.

@phlax phlax changed the title [WIP] examples: Cleanups/fixes for docker deps and builds examples: Cleanups/fixes for docker deps and builds Jun 30, 2022
@phlax phlax marked this pull request as ready for review June 30, 2022 20:54
@phlax phlax force-pushed the examples-hermetic branch from 7269ab7 to a4d3068 Compare June 30, 2022 21:05
@phlax phlax force-pushed the examples-hermetic branch 3 times, most recently from 96c6c45 to 6a35fa7 Compare July 1, 2022 06:48
@phlax phlax changed the title examples: Cleanups/fixes for docker deps and builds [WIP] examples: Cleanups/fixes for docker deps and builds Jul 1, 2022
@phlax phlax marked this pull request as draft July 1, 2022 10:49
@phlax phlax force-pushed the examples-hermetic branch 2 times, most recently from ad305fb to 0113c94 Compare July 1, 2022 13:28
@phlax phlax changed the title [WIP] examples: Cleanups/fixes for docker deps and builds examples: Cleanups/fixes for docker deps and builds Jul 1, 2022
examples/gzip/verify.sh Outdated Show resolved Hide resolved
examples/websocket/interact.sh Outdated Show resolved Hide resolved
@phlax phlax force-pushed the examples-hermetic branch from 331dee3 to 5d44fd6 Compare July 4, 2022 08:36
@phlax
Copy link
Member Author

phlax commented Jul 4, 2022

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit isn't fully completed, but will still attempt retrying.
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #21962 (comment) was created by @phlax.

see: more, trace.

@wrowe
Copy link
Contributor

wrowe commented Jul 7, 2022

/lgtm deps

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Jul 7, 2022
Copy link
Contributor

@wrowe wrowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, I have one question to resolve first.

What is the philosophy on updating these newly pinned dependencies as they bit rot? Is this something that needs to be documented?

@wrowe
Copy link
Contributor

wrowe commented Jul 7, 2022

/lgtm deps

@wrowe
Copy link
Contributor

wrowe commented Jul 7, 2022

The same question as before, though, before we merge, is there a logic to keeping the pinned dependencies from bit-rotting, @phlax?

@phlax
Copy link
Member Author

phlax commented Jul 7, 2022

The same question as before,...

Similar answer to before - there is examples/DEVELOPER.md which is my intention to update - but i have a few more changes i would like to make first

this one is a pretty straight refactoring - it shouldnt change how things work - but as you rightly point out it changes the standards for including deps amongst other things - im defo happy to follow up if that is ok

@wrowe
Copy link
Contributor

wrowe commented Jul 7, 2022

That's great, please create an issue pointing to these two (and other relevant) PR's to note the WIP/TODO?

@phlax phlax merged commit 823dc2e into envoyproxy:main Jul 8, 2022
@Moonsilence
Copy link

Hi! Came here from #20915 which is supposedly fixed with this here thread. But I still get ERROR [front-proxy_service2 internal] load metadata for docker.io/library/flask_service:python-3.10-slim-bullseye
That image doesn't exits in the repo nor locally.

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

hi @Moonsilence can you post the hash of your local repo when the error occurs

@Moonsilence
Copy link

Hi @phlax !

I cloned the repo this morning.

git rev-parse HEAD
cedb988

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

can you post the exact commands you are running when this happens

also, maybe docker/docker-compose versions

@Moonsilence
Copy link

Moonsilence commented Jul 12, 2022

@phlax Sure, appreciated!

I am trying to run the Sandbox "Front Proxy" from the latest official Envoy documentation:
https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/front_proxy#step-1-start-all-of-our-containers

The very first command is:
docker-compose build --pull

My version of docker-compose: v2.6.1
Using Docker Desktop on Windows, running Docker in the WSL2 Ubuntu Distro.

Error Messages:

 => CANCELED [front-proxy_front-envoy internal] load metadata for docker.io/envoyproxy/envoy-dev:latest                                                               2.0s
 => CANCELED [flask_service:python-3.10-slim-bullseye internal] load metadata for docker.io/library/python:3.10.5-slim-bullseye@sha256:2ae2b820fbcf4e1c5354ec39d0c7e  2.0s
 => ERROR [front-proxy_service1 internal] load metadata for docker.io/library/flask_service:python-3.10-slim-bullseye                                                 2.0s

 > [front-proxy_service1 internal] load metadata for docker.io/library/flask_service:python-3.10-slim-bullseye:

failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

ok - i see

some of the docs have the instruction of docker-compose up --build -d this is what i tested when fixing

and i think should work with little difference in outcome

ill update the docs to reflect the better command

can you confirm this command works ok @Moonsilence ?

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

hmm, actually im realising that doesnt pull the images if they exist already and that this was added for a reason (albeit an imperfect one)

ill test again further - i was convinced i fixed this at least for sme of the examples, but now im wondering...

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

ok - so it seems my fix didnt work 8( - altho it was needed for other reasons (and i think partially resolved the issue)

what does seem to work is doing the following...

$ docker-compose pull
$ docker-compose up --build -d

ill update the docs with these instructions

@Moonsilence
Copy link

@phlax Thanks, I have the "Front Proxy" example up and running, using your commands from previous post.

docker-compose pull

... gives me a warning:

 ⠿ flask_service Error                                                                                                                                                2.5s
WARNING: Some service image(s) must be built from source by running:
    docker compose build flask_service
Error response from daemon: pull access denied for flask_service, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

...but then...

docker compose build flask_service

... finally builds that image. Then your next command

docker-compose up --build -d

spins up the deployment.

Thanks!!

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

hmm - thats odd this is the outpuf of pull for me

..front-proxy$ docker-compose pull
Pulling flask_service ... done
Pulling front-envoy   ... done
Pulling service1      ... done
Pulling service2      ... done
WARNING: Some service image(s) must be built from source by running:
    docker-compose build flask_service
..front-proxy$ echo "$?"
0
$ docker --version
Docker version 20.10.10, build b485636

$ docker-compose --version
docker-compose version 1.29.2, build unknown

ill update the docs on the basis that it works mostly (i have tested in other similar env - debian <> ubuntu)

not sure why you are getting an error still - but v2.6.1 doesnt seem to exist for docker-compose

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

...for docker-compose

i see that is the version for docker compose (no hyphen)

this is currently untested im afraid

@phlax
Copy link
Member Author

phlax commented Jul 12, 2022

pr with updated docs instructions is here #22132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can not build for front-proxy of examples
3 participants