This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8521 from EOSIO/merge-release-2.0.1-to-master
Merge release 2.0.1 to master
- Loading branch information
Showing
30 changed files
with
533 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
steps: | ||
|
||
- label: ":aws: Amazon_Linux 2 - Build Pinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "amazonlinux:2.0.20190508" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "./scripts/eosio_build.sh -P -y" | ||
timeout: 180 | ||
|
||
- label: ":centos: CentOS 7.7 - Build Pinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "centos:7.7.1908" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "./scripts/eosio_build.sh -P -y" | ||
timeout: 180 | ||
|
||
- label: ":darwin: macOS 10.14 - Build Pinned" | ||
env: | ||
REPO: "[email protected]:EOSIO/eos.git" | ||
TEMPLATE: "10.14.6_6C_14G_40G" | ||
TEMPLATE_TAG: "clean::cicd::git-ssh::nas::brew::buildkite-agent" | ||
agents: "queue=mac-anka-large-node-fleet" | ||
command: | ||
- "git clone [email protected]:EOSIO/eos.git eos && cd eos && git checkout -f $BUILDKITE_BRANCH && git submodule update --init --recursive" | ||
- "cd eos && ./scripts/eosio_build.sh -P -y" | ||
plugins: | ||
- EOSIO/anka#v0.5.7: | ||
debug: true | ||
vm-name: "10.14.6_6C_14G_40G" | ||
no-volume: true | ||
modify-cpu: 12 | ||
modify-ram: 24 | ||
always-pull: true | ||
wait-network: true | ||
vm-registry-tag: "clean::cicd::git-ssh::nas::brew::buildkite-agent" | ||
pre-execute-sleep: 10 | ||
failover-registries: | ||
- "registry_1" | ||
- "registry_2" | ||
inherit-environment-vars: true | ||
- thedyrt/skip-checkout#v0.1.1: | ||
cd: ~ | ||
timeout: 180 | ||
|
||
- label: ":ubuntu: Ubuntu 16.04 - Build Pinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "ubuntu:16.04" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "apt update && apt upgrade -y && apt install -y git" | ||
- "./scripts/eosio_build.sh -P -y" | ||
timeout: 180 | ||
|
||
- label: ":ubuntu: Ubuntu 18.04 - Build Pinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "ubuntu:18.04" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "apt update && apt upgrade -y && apt install -y git" | ||
- "./scripts/eosio_build.sh -P -y" | ||
timeout: 180 | ||
|
||
- label: ":aws: Amazon_Linux 2 - Build UnPinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "amazonlinux:2.0.20190508" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "./scripts/eosio_build.sh -y" | ||
timeout: 180 | ||
|
||
- label: ":centos: CentOS 7.7 - Build UnPinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "centos:7.7.1908" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "./scripts/eosio_build.sh -y" | ||
timeout: 180 | ||
|
||
- label: ":darwin: macOS 10.14 - Build UnPinned" | ||
env: | ||
REPO: "[email protected]:EOSIO/eos.git" | ||
TEMPLATE: "10.14.6_6C_14G_40G" | ||
TEMPLATE_TAG: "clean::cicd::git-ssh::nas::brew::buildkite-agent" | ||
agents: "queue=mac-anka-large-node-fleet" | ||
command: | ||
- "git clone [email protected]:EOSIO/eos.git eos && cd eos && git checkout -f $BUILDKITE_BRANCH && git submodule update --init --recursive" | ||
- "cd eos && ./scripts/eosio_build.sh -y" | ||
plugins: | ||
- EOSIO/anka#v0.5.7: | ||
debug: true | ||
vm-name: "10.14.6_6C_14G_40G" | ||
no-volume: true | ||
modify-cpu: 12 | ||
modify-ram: 24 | ||
always-pull: true | ||
wait-network: true | ||
vm-registry-tag: "clean::cicd::git-ssh::nas::brew::buildkite-agent" | ||
pre-execute-sleep: 10 | ||
failover-registries: | ||
- "registry_1" | ||
- "registry_2" | ||
inherit-environment-vars: true | ||
- thedyrt/skip-checkout#v0.1.1: | ||
cd: ~ | ||
timeout: 180 | ||
|
||
- label: ":ubuntu: Ubuntu 18.04 - Build UnPinned" | ||
plugins: | ||
- docker#v3.3.0: | ||
image: "ubuntu:18.04" | ||
always-pull: true | ||
agents: | ||
queue: "automation-eks-eos-builder-fleet" | ||
command: | ||
- "apt update && apt upgrade -y && apt install -y git" | ||
- "./scripts/eosio_build.sh -y" | ||
timeout: 180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
#!/usr/bin/env python | ||
|
||
import configparser | ||
import os | ||
import re | ||
import requests | ||
import shutil | ||
import subprocess | ||
import sys | ||
import tarfile | ||
|
||
|
||
def is_tag(ref): | ||
regex = re.compile('v[0-9]+\.[0-9]+\..*') | ||
return regex.match(ref) | ||
|
||
def get_commit_for_branch(branch): | ||
commit = None | ||
r = requests.get('https://api.github.com/repos/EOSIO/eos/git/refs/heads/{}'.format(branch)) | ||
if r.status_code == 200: | ||
commit = r.json().get('object').get('sha') | ||
|
||
return commit | ||
|
||
def get_commit_for_tag(tag): | ||
commit = None | ||
r = requests.get('https://api.github.com/repos/EOSIO/eos/git/refs/tags/{}'.format(tag)) | ||
if r.status_code == 200: | ||
commit = r.json().get('object').get('sha') | ||
|
||
return commit | ||
|
||
def sanitize_label(label): | ||
invalid = [' ', '..', '.', '/', '~', '='] | ||
for c in invalid: | ||
label = label.replace(c, '-') | ||
|
||
return label.strip('-') | ||
|
||
CURRENT_COMMIT = os.environ.get('BUILDKITE_COMMIT') | ||
BK_TOKEN = os.environ.get('BUILDKITE_API_KEY') | ||
if not BK_TOKEN: | ||
sys.exit('Buildkite token not set') | ||
headers = { | ||
'Authorization': 'Bearer {}'.format(BK_TOKEN) | ||
} | ||
|
||
try: | ||
shutil.rmtree('builds') | ||
except OSError: | ||
pass | ||
os.mkdir('builds') | ||
|
||
existing_build_found = False | ||
if CURRENT_COMMIT: | ||
print 'Attempting to get build directory for this branch ({})...'.format(CURRENT_COMMIT) | ||
r = requests.get('https://api.buildkite.com/v2/organizations/EOSIO/pipelines/eosio/builds?commit={}'.format(CURRENT_COMMIT), headers=headers) | ||
if r.status_code == 200: | ||
resp = r.json() | ||
if resp: | ||
build = resp.pop(0) | ||
for job in build.get('jobs'): | ||
job_name = job.get('name') | ||
if job_name == ':ubuntu: 18.04 Build': | ||
dir_r = requests.get(job.get('artifacts_url'), headers=headers) | ||
if dir_r.status_code == 200: | ||
download_url = dir_r.json().pop().get('download_url') | ||
if download_url: | ||
dl_r = requests.get(download_url, headers=headers) | ||
open('current_build.tar.gz', 'wb').write(dl_r.content) | ||
tar = tarfile.open('current_build.tar.gz') | ||
tar.extractall(path='builds/current') | ||
tar.close() | ||
os.remove('current_build.tar.gz') | ||
existing_build_found = True | ||
else: | ||
print 'No builds found for this branch ({})'.format(CURRENT_COMMIT) | ||
|
||
if not os.path.exists('../tests/multiversion.conf'): | ||
sys.exit('Unable to find config file') | ||
|
||
commits = {} | ||
config = configparser.ConfigParser() | ||
config.read('../tests/multiversion.conf') | ||
for item in config.items('eosio'): | ||
label = sanitize_label(item[0]) | ||
if is_tag(item[1]): | ||
commits[label] = get_commit_for_tag(item[1]) | ||
elif get_commit_for_branch(item[1]): | ||
commits[label] = get_commit_for_branch(item[1]) | ||
else: | ||
commits[label] = item[1] | ||
|
||
PWD = os.getcwd() | ||
config_path = '../tests/multiversion_paths.conf' | ||
if existing_build_found: | ||
config_path = '{0}/builds/current/build/tests/multiversion_paths.conf'.format(PWD) | ||
|
||
with open(config_path, 'w') as fp: | ||
fp.write('[eosio]\n') | ||
for label in commits.keys(): | ||
fp.write('{}={}/builds/{}/build\n'.format(label, PWD, label)) | ||
|
||
print 'Getting build data...' | ||
artifact_urls = {} | ||
for label, commit in commits.items(): | ||
r = requests.get('https://api.buildkite.com/v2/organizations/EOSIO/pipelines/eosio/builds?commit={}'.format(commit), headers=headers) | ||
if r.status_code == 200: | ||
resp = r.json() | ||
if resp: | ||
build = resp.pop(0) | ||
for job in build.get('jobs'): | ||
job_name = job.get('name') | ||
if job_name == ':ubuntu: 18.04 Build': | ||
artifact_urls[label] = job.get('artifacts_url') | ||
else: | ||
print 'No builds found for {}'.format(label) | ||
else: | ||
print r.text | ||
sys.exit('Something went wrong getting build data for {}'.format(label)) | ||
|
||
print 'Downloading and extracting build directories...' | ||
for label, artifact_url in artifact_urls.items(): | ||
print ' +++ {}'.format(label) | ||
r = requests.get(artifact_url, headers=headers) | ||
if r.status_code == 200: | ||
download_url = r.json().pop().get('download_url') | ||
if download_url: | ||
dl_r = requests.get(download_url, headers=headers) | ||
open('{}_build.tar.gz'.format(label), 'wb').write(dl_r.content) | ||
tar = tarfile.open('{}_build.tar.gz'.format(label)) | ||
tar.extractall(path='builds/{}'.format(label)) | ||
tar.close() | ||
os.remove('{}_build.tar.gz'.format(label)) | ||
else: | ||
sys.exit('Unable to get artifact download url for {}'.format(label)) | ||
else: | ||
sys.exit('Something went wrong getting artifact data for {}'.format(label)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.