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

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ericholguin
Copy link
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
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?

dev/t3c/run.sh Outdated Show resolved Hide resolved
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
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
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
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
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
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 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.

2 participants