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

Add go mod vendor to atc.dev.sh #7180

Open
ericholguin wants to merge 3 commits intoapache:masterfrom
ericholguin:devciab-t3c-gomod
Open

Add go mod vendor to atc.dev.sh #7180
ericholguin wants to merge 3 commits intoapache:masterfrom
ericholguin:devciab-t3c-gomod

Conversation

@ericholguin
Copy link
Copy Markdown
Contributor

@ericholguin ericholguin commented Nov 8, 2022

Adds the go mod vendor command to the t3c run.sh file, for when a user has a clean repo t3c won't fail to start up due to missing packages


Which Traffic Control components are affected by this PR?

  • Dev CDN in a Box

What is the best way to verify this PR?

Have a clean repo or delete /vendor/golang.org/x/

cd dev/
source atc.dev.sh
atc build
atc start

Should find that t3c starts correctly and you will see /vendor/golang.org/x/ has been created and contains packages

PR submission checklist

Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

The thing about adding go mod vendor to the t3c service is that the trafficops and trafficmonitor services also fail to build binaries and run i go mod vendor is not run for them.

So maybe the trafficops and trafficmonitor services could add a check to see if vendor/golang.org/x and vendor/modules.txt (which indicates that vendoring is complete) exist, and if not, wait until it does before continuing?

Comment thread dev/t3c/run.sh Outdated
Comment thread dev/atc.dev.sh Outdated
Comment on lines +22 to +25
if [ ! -d "vendor/golang/x" ]; then
go mod vendor
fi
docker-compose up -d --build
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If atc-build is run before docker-compose up, go mod vendor can be run in a container so the user doesn't need go (or the latest go version)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So run go mod vendor in the traffic ops Dockerfile?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nah, running go mod vendor from one of the docker-compose services using docker-compose run

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so, go mod vendor would go between docker-compose build and docker-compose up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand, but if you want to just add it to your open PR: #7142 I can close this and review that.

@ericholguin ericholguin changed the title Add go mod vendor to t3c run.sh Add go mod vendor to atc.dev.sh Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants