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

Use go modules and go 1.14/1.15 #2490

Closed
petderek opened this issue Jun 24, 2020 · 7 comments
Closed

Use go modules and go 1.14/1.15 #2490

petderek opened this issue Jun 24, 2020 · 7 comments

Comments

@petderek
Copy link
Contributor

petderek commented Jun 24, 2020

Summary

Its 2020, time to update to go modules! We should update our build system to use the latest Go version available in AL2 as well.

Expected Behavior

I can update my dependencies and go build easily without installing a 3rd party dependency manager. 💪

Observed Behavior

I have to install a 3rd party dependency manager. ☹️

Environment Details

This should be tested:

  • in travis
  • in codebuild
  • on a mac
  • on a linux machine
  • on/off amazon's corp
@yhlee-aws
Copy link
Contributor

work in progress: #2493

@petderek petderek changed the title Use go modules and go 1.13/1.14 Use go modules and go 1.14/1.15 Aug 12, 2020
@petderek
Copy link
Contributor Author

1.15 was just released, meaning 1.13 is no longer supported.

@mythri-garaga
Copy link
Contributor

Updated to Go 1.15 in #2660

@fierlion
Copy link
Member

I'm currently testing this:
in github action (in place of travis)
in codebuild
on a mac
on a linux machine
on/off amazon's corp

@fierlion
Copy link
Member

on a fresh ec2 instance I ran:

sudo yum -y install gcc git aws-cli wget rpm-build
GOVERSION="1.15"
GOLANG_TAR="go${GOVERSION}.linux-amd64.tar.gz"
wget -O /tmp/${GOLANG_TAR} https://storage.googleapis.com/golang/${GOLANG_TAR}
sudo tar -C /usr/local -xzf /tmp/${GOLANG_TAR}
mkdir -p ~/go/bin
mkdir -p ~/go/src

I added the following to my .bash_profile:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOROOT/bin:$GOBIN

then I ran:

source ~/.bash_profile
go get github.com/aws/amazon-ecs-agent && cd ~/go/src/github.com/aws/amazon-ecs-agent
go build -installsuffix cgo -a -ldflags ' -s' -o out/amazon-ecs-agent ./agent/

and a new agent was built.

I also tested on mac with the same golang setup -- downloaded go 1.15.7 (latest)

source ~/.bash_profile
go get github.com/aws/amazon-ecs-agent && cd ~/go/src/github.com/aws/amazon-ecs-agent
go build -installsuffix cgo -a -ldflags ' -s' -o out/amazon-ecs-agent ./agent/

also tested with codebuild and github actions.

@fierlion
Copy link
Member

note this is currently blocked by issues related to versioning as it relates to go modules.

@fierlion
Copy link
Member

Closing for now. This is not on our roadmap.

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

No branches or pull requests

5 participants