Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Combine CDN in a Box Dockerfiles using build stage targets where possible#5710

Merged
rawlinp merged 17 commits intoapache:masterfrom
zrhoffman:ciab-stage-targets
Apr 16, 2021
Merged

Combine CDN in a Box Dockerfiles using build stage targets where possible#5710
rawlinp merged 17 commits intoapache:masterfrom
zrhoffman:ciab-stage-targets

Conversation

@zrhoffman
Copy link
Member

@zrhoffman zrhoffman commented Apr 2, 2021

What does this PR (Pull Request) do?

Currently, if you try to build the trafficmonitor-debug, trafficops-debug, and trafficstats-debug images without the trafficmonitor, trafficops, and trafficstats existing,

docker-compose -f docker-compose.yml -f optional/docker-compose.debugging.yml build --parallel trafficops

it will fail to build with an error like

 ---> 82cad2818884
Step 5/6 : FROM trafficops
pull access denied for trafficops, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Service 'trafficops' failed to build

because you need to build those images first. You can get around that by simply attempting to build everything twice:

docker-compose -f docker-compose.yml -f optional/docker-compose.debugging.yml build --parallel
docker-compose -f docker-compose.yml -f optional/docker-compose.debugging.yml build --parallel

But updating RPMs in the debug images is still annoying because it requires building everything twice in this way. This PR fixes that behavior.

This PR

  • Makes the Traffic Monitor, Traffic Ops, and Traffic Ops debug images build stage targets within the non-debug Dockerfiles

  • Removes the trafficmonitor-nondebug, trafficops-nondebug, and trafficstats-nondebug services from the docker-compose.debugging.yml compose file

  • Makes edge build the edge target of cache/Dockerfile and makes mid-01 and mid-02 build the mid target of cache/Dockerfile

  • Adds the ability to debug the CDN in a Box enroller

  • This PR is not related to any Issue

Which Traffic Control components are affected by this PR?

  • CDN in a Box

What is the best way to verify this PR?

  • Untag the trafficmonitor, trafficops, and trafficstats images and then verify that running

    docker-compose -f docker-compose.yml -f optional/docker-compose.debugging.yml build --parallel

    succeeds

  • Following the debugging documentation, set a breakpoint in enroller.go and try to hit it

If this is a bug fix, what versions of Traffic Control are affected?

The following criteria are ALL met by this PR

  • CiaB changed only, tests unnecessary
  • This PR contains documentation
  • An update to CHANGELOG.md is unnecessary
  • This PR includes any and all required license headers
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

@zrhoffman zrhoffman added bug something isn't working as intended cdn-in-a-box related to the Docker-based CDN-in-a-Box system labels Apr 2, 2021
@zrhoffman zrhoffman changed the title Combine CDN in a Box Dockerfiles using building stage targets where possible Combine CDN in a Box Dockerfiles using build stage targets where possible Apr 5, 2021
@zrhoffman zrhoffman force-pushed the ciab-stage-targets branch 2 times, most recently from 0d03f75 to c62fa61 Compare April 9, 2021 17:22
@zrhoffman zrhoffman force-pushed the ciab-stage-targets branch from c62fa61 to fa69866 Compare April 9, 2021 17:59
@zrhoffman zrhoffman added improvement The functionality exists but it could be improved in some way. and removed bug something isn't working as intended labels Apr 9, 2021
Copy link
Collaborator

@tcfdev tcfdev left a comment

Choose a reason for hiding this comment

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

Here's a few thoughts and notes based on reading the changes. I'm working on validating functionality separately.

@tcfdev
Copy link
Collaborator

tcfdev commented Apr 16, 2021

Confirmed debugging possible in Goland and VSCode.

Copy link
Collaborator

@tcfdev tcfdev left a comment

Choose a reason for hiding this comment

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

Code reviewed and functionality tested. LGTM!

Approved!

@rawlinp rawlinp merged commit c1b7b10 into apache:master Apr 16, 2021
@zrhoffman zrhoffman deleted the ciab-stage-targets branch April 16, 2021 17:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cdn-in-a-box related to the Docker-based CDN-in-a-Box system improvement The functionality exists but it could be improved in some way.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants