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

Install gcc on staging generic-worker worker types #195

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions config/imagesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ generic-worker-win2012r2-staging:
workerImplementation: generic-worker
aws:
amis:
us-east-1: ami-0162f92052875bf7e
us-west-1: ami-0f6b26130f2f9ce2c
us-west-2: ami-0dfd8045878e6cd08
gcp:
image: projects/community-tc-workers/global/images/generic-worker-win2012r2-staging-hasr18iepqtggvlswlku
us-east-1: ami-0f892d6ff7cdc52e7
us-west-1: ami-0cf711badfa2f50fc
us-west-2: ami-02ed2a69fdfdef0bc
# Currently not deployed in gcp...
# gcp:
# image: projects/community-tc-workers/global/images/generic-worker-win2012r2-staging-hasr18iepqtggvlswlku
workerConfig:
genericWorker:
config:
Expand Down Expand Up @@ -133,9 +134,9 @@ generic-worker-ubuntu-18-04-staging:
workerImplementation: generic-worker
aws:
amis:
us-east-1: ami-06ce1a5f3039ac646
us-west-1: ami-0bd5b1b63c47a7b65
us-west-2: ami-0a396cff215e28640
us-east-1: ami-0e785d8c0d91ba485
us-west-1: ami-03b04649c13e7ec0c
us-west-2: ami-021550227b98d65e7
workerConfig:
genericWorker:
config:
Expand Down
2 changes: 1 addition & 1 deletion config/projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ taskcluster:
owner: [email protected]
emailOnError: true
imageset: generic-worker-win2012r2-staging
cloud: gcp
cloud: aws
maxCapacity: 10
workerConfig:
genericWorker:
Expand Down
39 changes: 22 additions & 17 deletions imagesets/generic-worker-ubuntu-18-04-staging/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ exec &> /var/log/bootstrap.log

# Version numbers ####################
WORKER_RUNNER_VERSION='v1.0.1'
# GENERIC_WORKER_REF='v16.5.6'
GENERIC_WORKER_VERSION='v16.5.6'
LIVELOG_VERSION='v1.1.0'
TASKCLUSTER_PROXY_VERSION='v5.1.0'
GENERIC_WORKER_REF='v16.5.6'
######################################

function retry {
Expand Down Expand Up @@ -36,7 +37,8 @@ start_time="$(date '+%s')"

retry apt update
DEBIAN_FRONTEND=noninteractive apt upgrade -yq
retry apt install -y apt-transport-https ca-certificates curl software-properties-common git tar python3-venv python-virtualenv
# retry apt install -y apt-transport-https ca-certificates curl software-properties-common git tar python3-venv python-virtualenv build-essential
retry apt install -y apt-transport-https ca-certificates curl software-properties-common gzip python3-venv python-virtualenv build-essential

# install docker
retry curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
Expand All @@ -48,25 +50,28 @@ sleep 5
systemctl status docker | grep "Started Docker Application Container Engine"
usermod -aG docker ubuntu

# build generic-worker from ${GENERIC_WORKER_REF} commit / branch / tag etc
retry curl -L 'https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz' > go.tar.gz
tar xvfz go.tar.gz -C /usr/local
export HOME=/root
export GOPATH=~/go
export GOROOT=/usr/local/go
export PATH="${GOROOT}/bin:${GOPATH}/bin:${PATH}"
go get -d github.com/taskcluster/generic-worker
cd "${GOPATH}/src/github.com/taskcluster/generic-worker"
git checkout "${GENERIC_WORKER_REF}"
CGO_ENABLED=0 go install -tags multiuser -ldflags "-X main.revision=$(git rev-parse HEAD)" github.com/taskcluster/generic-worker
mv "${GOPATH}/bin/generic-worker" /usr/local/bin/

# install livelog and taskcluster-proxy
# # build generic-worker from ${GENERIC_WORKER_REF} commit / branch / tag etc
# retry curl -L 'https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz' > go.tar.gz
# tar xvfz go.tar.gz -C /usr/local
# export HOME=/root
# export GOPATH=~/go
# export GOROOT=/usr/local/go
# export PATH="${GOROOT}/bin:${GOPATH}/bin:${PATH}"
# go get -d github.com/taskcluster/generic-worker
# cd "${GOPATH}/src/github.com/taskcluster/generic-worker"
# git checkout "${GENERIC_WORKER_REF}"
# CGO_ENABLED=0 go install -tags multiuser -ldflags "-X main.revision=$(git rev-parse HEAD)" github.com/taskcluster/generic-worker
# mv "${GOPATH}/bin/generic-worker" /usr/local/bin/
#
# # install livelog and taskcluster-proxy
cd /usr/local/bin
# next line can be removed if building generic-worker...
retry curl -L "https://github.com/taskcluster/generic-worker/releases/download/${GENERIC_WORKER_VERSION}/generic-worker-multiuser-linux-amd64" > generic-worker
retry curl -L "https://github.com/taskcluster/taskcluster-worker-runner/releases/download/${WORKER_RUNNER_VERSION}/start-worker-linux-amd64" > start-worker
retry curl -L "https://github.com/taskcluster/livelog/releases/download/${LIVELOG_VERSION}/livelog-linux-amd64" > livelog
retry curl -L "https://github.com/taskcluster/taskcluster-proxy/releases/download/${TASKCLUSTER_PROXY_VERSION}/taskcluster-proxy-linux-amd64" > taskcluster-proxy
chmod a+x start-worker taskcluster-proxy livelog
# chmod a+x start-worker taskcluster-proxy livelog
chmod a+x generic-worker start-worker taskcluster-proxy livelog

mkdir -p /etc/generic-worker
mkdir -p /var/local/generic-worker
Expand Down
2 changes: 1 addition & 1 deletion imagesets/generic-worker-win2012r2-staging/bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ $client.DownloadFile("https://www.cygwin.com/setup-x86_64.exe", "C:\cygwin-setup

# install cygwin
# complete package list: https://cygwin.com/packages/package_list.html
Start-Process "C:\cygwin-setup-x86_64.exe" -ArgumentList "--quiet-mode --wait --root C:\cygwin --site http://cygwin.mirror.constant.com --packages openssh,vim,curl,tar,wget,zip,unzip,diffutils,bzr" -Wait -NoNewWindow -PassThru -RedirectStandardOutput "C:\cygwin_install.log" -RedirectStandardError "C:\cygwin_install.err"
Start-Process "C:\cygwin-setup-x86_64.exe" -ArgumentList "--quiet-mode --wait --root C:\cygwin --site http://cygwin.mirror.constant.com --packages openssh,vim,curl,tar,wget,zip,unzip,diffutils,bzr,gcc-g++" -Wait -NoNewWindow -PassThru -RedirectStandardOutput "C:\cygwin_install.log" -RedirectStandardError "C:\cygwin_install.err"

# open up firewall for ssh daemon
New-NetFirewallRule -DisplayName "Allow SSH inbound" -Direction Inbound -LocalPort 22 -Protocol TCP -Action Allow
Expand Down