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

Simplify ARM triples, add script to upload ARM tarballs correctly #355

Closed
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1,7 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

travis_fold_start () {
printf "travis_fold:start:$1\n"
@@ -31,14 +32,14 @@ run_salt () {
}


if [ "${SALT_NODE_ID}" = "test" ]; then
if [[ "${SALT_NODE_ID}" == "test" ]]; then
# Using .travis.yml to specify Python 3.5 to be preinstalled, just to check
printf "Using $(python3 --version) at $(which python3)\n"

# Run test suite separately for parallelism
./test.py
else
if [ "${SALT_FROM_SCRATCH}" = "true" ]; then
if [[ "${SALT_FROM_SCRATCH}" == "true" ]]; then
run_salt 'scratch'
else
git fetch origin master:master
@@ -51,7 +52,7 @@ else

# Only run tests against the new configuration
# TODO: don't hard-code this
if [ "${SALT_NODE_ID}" = "servo-master1" ]; then
if [[ "${SALT_NODE_ID}" == "servo-master1" ]]; then
./test.py sls.buildbot.master sls.nginx
fi
fi
@@ -1,11 +1,12 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

install_salt () {
# Ensure that pinned versions match as closely as possible
if [ "${OS_NAME}" = "linux" ]; then
if [[ "${OS_NAME}" == "linux" ]]; then
printf "$0: installing salt for Linux\n"
# Use Trusty (Ubuntu 14.04) on Travis
# Don't autostart services
@@ -14,7 +15,7 @@ install_salt () {
printf 'deb http://repo.saltstack.com/apt/ubuntu/14.04/amd64/archive/2015.5.8 trusty main\n' | sudo tee /etc/apt/sources.list.d/saltstack.list >/dev/null
sudo apt-get -y update
sudo apt-get -y install salt-minion=2015.5.8+ds-1
elif [ "${OS_NAME}" = "osx" ]; then
elif [[ "${OS_NAME}" == "osx" ]]; then
printf "$0: installing salt for Mac OS X\n"
brew update
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/3461c9c74b2f3aba9a6fbd7165823c81dc2b4792/Formula/saltstack.rb
@@ -63,16 +64,16 @@ while true; do
esac
done

if [ "$#" -lt 1 ]; then
if [[ "$#" -lt 1 ]]; then
printf >&2 "usage: $0 [-c <config_dir> [-F]] [--] os_name\n"
exit 1
fi

OS_NAME="$1"
if [ -z "${CONFIGURE_ONLY}" ]; then
if [[ -z "${CONFIGURE_ONLY}" ]]; then
install_salt
fi

if [ -n "${TEMPORARY_CONFIG_DIR}" ]; then
if [[ -n "${TEMPORARY_CONFIG_DIR}" ]]; then
configure_salt
fi
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

setup_salt_roots () {
sudo rm -rf /srv/salt
@@ -0,0 +1,61 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail


usage () {
printf "usage: $0 <path_to_rootfs_tarball> <arch> <version>\n"
printf "\n"
printf "example: $0 ./armhf-trusty-libs.tgz arm32 v3\n"
}


upload () {
local -r local_filename="$1"
local -r arch="$2"
local -r version="$3"

if [[ "${arch}" == "arm32" ]]; then
local -r triple="arm-unknown-linux-gnueabihf"
elif [[ "${arch}" == "arm64" ]]; then
local -r triple="aarch64-unknown-linux-gnu"
else
printf >&2 "$0: assert: unknown arch $2 passed to upload()\n"
return 1
fi

local -r remote_location="s3://servo-rust/ARM/${triple}-trusty-libs/${version}/${triple}-trusty-libs-${version}.tgz"
printf "Uploading ${local_filename} to ${remote_location}. Proceed? [Y/n]"
local proceed
read proceed
if [[ "${proceed}" == "N" || "${proceed}" == "n" ]]; then
printf "Upload aborted.\n"
return 0
fi
s3cmd put "${local_filename}" "${remote_location}"
}

main () {
if [[ "$#" != 3 ]]; then
usage >&2
exit 1
fi
if [[ ! -e "$1" ]]; then
printf >&2 "$0: $1 does not exist for uploading\n"
exit 1
fi
if [[ "$2" != "arm32" && "$2" != "arm64" ]]; then
printf >&2 "$0: unknown arch $2, please specify either arm32 or arm64\n"
exit 1
fi
if [[ "$3" != v* ]]; then
printf >&2 "$0: version $3 must start with a v\n"
exit 1
fi

upload "$@"
}

main "$@"
@@ -33,34 +33,34 @@ arm-dependencies:
{% for target in arm.targets %}
libs-{{ target.name }}:
libs-{{ target.triple }}:
archive.extracted:
- name: {{ common.servo_home }}/rootfs-trusty-{{ target.name }}/{{ target.version }}
- source: https://servo-rust.s3.amazonaws.com/ARM/{{ target.download_name }}/{{ target.version }}/{{ target.download_name }}-{{ target.version }}.tgz
- name: {{ common.servo_home }}/rootfs-trusty-{{ target.triple }}/{{ target.version }}
- source: https://servo-rust.s3.amazonaws.com/ARM/{{ target.triple }}-trusty-libs/{{ target.version }}/{{ target.triple }}-trusty-libs-{{ target.version }}.tgz
- source_hash: sha512={{ target.sha512 }}
- archive_format: tar
- archive_user: servo
{% for binary in binaries %}
{{ common.servo_home }}/bin/{{ target.symlink_name }}-{{ binary }}:
{{ common.servo_home }}/bin/{{ target.triple }}-{{ binary }}:
file.symlink:
- target: /usr/bin/{{ target.name }}-{{ binary }}
- target: /usr/bin/{{ target.ubuntu_triple }}-{{ binary }}
- makedirs: True
- require:
- archive: libs-{{ target.name }}
- archive: libs-{{ target.triple }}
{% endfor %}
{{ common.servo_home }}/rootfs-trusty-{{ target.name }}/{{ target.version }}:
{{ common.servo_home }}/rootfs-trusty-{{ target.triple }}/{{ target.version }}:
file.directory:
- user: servo
- group: servo
- dir_mode: 755
- file_mode: 644
- makedirs: True
- require:
- archive: libs-{{ target.name }}
- archive: libs-{{ target.triple }}
{{ common.servo_home }}/rootfs-trusty-{{ target.name }}:
{{ common.servo_home }}/rootfs-trusty-{{ target.triple }}:
file.directory:
- user: servo
- group: servo
@@ -69,14 +69,14 @@ libs-{{ target.name }}:
- makedirs: True
- clean: True
- require:
- file: {{ common.servo_home }}/rootfs-trusty-{{ target.name }}/{{ target.version }}
- file: {{ common.servo_home }}/rootfs-trusty-{{ target.triple }}/{{ target.version }}
{% for root in ['usr/include', 'usr/lib', 'lib'] %}
/{{ root }}/{{ target.name }}:
/{{ root }}/{{ target.ubuntu_triple }}:
file.symlink:
- target: {{ common.servo_home }}/rootfs-trusty-{{ target.name }}/{{ target.version }}/{{ root }}/{{ target.name }}
- target: {{ common.servo_home }}/rootfs-trusty-{{ target.triple }}/{{ target.version }}/{{ root }}/{{ target.ubuntu_triple }}
- require:
- archive: libs-{{ target.name }}
- archive: libs-{{ target.triple }}
{% endfor %}
{% endfor %}
@@ -92,6 +92,6 @@ libs-{{ target.name }}:
- require:
{% for target in arm.targets %}
{% for binary in binaries %}
- file: {{ common.servo_home }}/bin/{{ target.symlink_name }}-{{ binary }}
- file: {{ common.servo_home }}/bin/{{ target.triple }}-{{ binary }}
{% endfor %}
{% endfor %}
@@ -16,16 +16,14 @@
set arm = {
'targets': [
{
'name': 'arm-linux-gnueabihf',
'download_name': 'armhf-trusty-libs',
'symlink_name': 'arm-unknown-linux-gnueabihf',
'triple': 'arm-unknown-linux-gnueabihf',
'ubuntu_triple': 'arm-linux-gnueabihf',
'version': 'v2',
'sha512': '9273c980b45f2b8602afb98f904582b7de749cab5d388d834c085c95387f3423f330f30d85ce6e5ad55ebdd68fdd03602d3b6db23da07fb2f6dcafb429e79ac7'
},
{
'name': 'aarch64-linux-gnu',
'download_name': 'arm64-trusty-libs',
'symlink_name': 'aarch64-unknown-linux-gnu',
'triple': 'aarch64-unknown-linux-gnu',
'ubuntu_triple': 'aarch64-linux-gnu',
'version': 'v2',
'sha512': 'a08a90f8a91d644c9e8d7af7fe50fca8a92cdbe5dcbe5faebc16333c9429acd1f487add66a847b64f83ed87ee8e14d5b71efc0a3dba35657f527e649e6e3e35c'
}
@@ -11,7 +11,7 @@

INTERPRETERS = {
'py': 'python3',
'sh': 'sh'
'sh': 'bash'
}


ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.