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 release checklist, cleanup version output, add release pipeline #255

Merged
merged 11 commits into from
Jun 5, 2020
20 changes: 20 additions & 0 deletions .azure-pipelines/azure-pipelines-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
trigger:
branches:
include:
- 'oe_port'
paths:
exclude:
- '*.md'
- 'docs/'
pr: none

extends:
template: template.yml
parameters:
publish: true
apt_repo_blob_container: apt-dev
# Use hosted agent for building to ensure dev-releases are always built on a fresh VM.
# Our own pools currently re-use VMs to decrease queueing and execution time and
# this makes it easier to mess with them, e.g. via external pull requests.
build_pool:
vmImage: ubuntu-latest
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ schedules:
extends:
template: template.yml
parameters:
skip_publish: true
publish: false
test_timeout_minutes: 120 # ethread==1 takes longer to run
ethreads:
- 1
Expand Down
18 changes: 18 additions & 0 deletions .azure-pipelines/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
trigger: none
pr: none

extends:
template: template.yml
parameters:
publish: true
apt_repo_blob_container: apt
# Use hosted agent for building to ensure releases are always built on a fresh VM.
# Our own pools currently re-use VMs to decrease queueing and execution time and
# this makes it easier to mess with them, e.g. via external pull requests.
build_pool:
vmImage: ubuntu-latest
test_timeout_minutes: 120 # ethread==1 takes longer to run
ethreads:
- 1
- 4
- 8
14 changes: 4 additions & 10 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
trigger:
branches:
include:
- 'oe_port'
paths:
exclude:
- 'README.md'
- 'docs/'

trigger: none
pr:
branches:
include:
- '*' # must quote since "*" is a YAML reserved character; we want a string
paths:
exclude:
- 'README.md'
- '*.md'
- 'docs/'

extends:
template: template.yml
parameters:
publish: false
9 changes: 6 additions & 3 deletions .azure-pipelines/scripts/install_prerequisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ sudo apt-get install -y \
make gcc g++ bc python xutils-dev flex bison autogen libgcrypt20-dev libjson-c-dev \
autopoint pkgconf autoconf libtool libcurl4-openssl-dev libprotobuf-dev libprotobuf-c-dev protobuf-compiler protobuf-c-compiler libssl-dev \
ninja-build ansible linux-headers-$(uname -r) \
docker.io python3-venv unzip dkms debhelper apt-utils pax-utils openjdk-8-jdk-headless \
python3-venv unzip dkms debhelper apt-utils pax-utils openjdk-8-jdk-headless \
expect

# Allow to run Docker without sudo
sudo chmod u+s $(which docker)
if [[ ! -x "$(command -v docker)" ]]; then
sudo apt-get install -y docker.io
# Allow to run Docker without sudo
sudo chmod u+s $(which docker)
fi
14 changes: 7 additions & 7 deletions .azure-pipelines/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,18 @@ parameters:
default:
debug: /opt/sgx-lkl-debug
nonrelease: /opt/sgx-lkl-nonrelease
- name: 'build_pool'
type: object
default:
name: scaleset-nosgx
- name: 'test_pool_mapping'
type: object
default:
sw:
name: scaleset-nosgx
hw:
name: scaleset-sgx
- name: 'skip_publish'
- name: 'publish'
type: boolean
default: false
- name: 'apt_repo_blob_container'
Expand All @@ -58,8 +62,7 @@ stages:
- job: build_${{ build_mode }}
displayName: 'Build: ${{ build_mode }}'

pool:
name: "scaleset-nosgx"
pool: ${{ parameters.build_pool }}

steps:
- checkout: self
Expand Down Expand Up @@ -164,16 +167,13 @@ stages:
pathtoPublish: "report"
artifactName: logs

- ${{ if not(parameters.skip_publish) }}:
- ${{ if parameters.publish }}:
- stage: publish
displayName: Publish
dependsOn: build_and_test
jobs:
- job: Publish

# Don't publish for PR builds.
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))

# A free hosted agent is good enough for the publish job.
# It also has the Azure CLI installed already.
pool:
Expand Down
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Release Checklist

- Choose the next [CalVer](https://calver.org/) version, e.g. `20.05` (`YY.MM`).
- Ensure that `CHANGELOG.md` is up-to-date including version numbers.
- Create a release branch `release/20.05` from master.
- Critical issues should have fixes delivered to both master and `release/20.05`.
- On the release branch, update the version in `VERSION`.
- Commit and push.
- Run the [release pipeline](https://dev.azure.com/sgx-lkl/sgx-lkl/_build?definitionId=5) and wait for successful completion.
- Create and push a new git tag `20.05` from the release branch.
- Switch to master and update `VERSION` to `20.06-dev` with the expected next version.

## Pre-release and patch releases

- Any pre-release and patch releases are from commits in the release branch `release/20.05`.
- Release candidates have a version like `20.05-rc1`,`20.05-rc2`, etc.
- After a final release (`20.05`), patches have a version like `20.05.1`, `20.05.2`, etc.
- Make sure to update `VERSION` with the pre-release / patch version.
5 changes: 3 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ CFLAGS_MAIN = -I$(OE_SDK_INCLUDES)
CFLAGS_ENCLAVE = -I$(OE_SDK_INCLUDES) -I${OE_SDK_INCLUDES}/openenclave/3rdparty -fPIE
LINK_MAIN =

GIT_VERSION = "$(shell git describe --dirty --always --tags || echo unknown)"
SGXLKL_VERSION = "$(shell cat ${SGXLKL_ROOT}/VERSION)"
SGXLKL_GIT_COMMIT = "$(shell git rev-parse --short HEAD || echo unknown)"
LKL_VERSION = "$(shell make --quiet -C ${SGXLKL_ROOT}/lkl kernelversion)"

CFLAGS_MAIN += $(SGXLKL_CFLAGS_EXTRA) -DGIT_VERSION=\"$(GIT_VERSION)\" -DLKL_VERSION=\"$(LKL_VERSION)\"
CFLAGS_MAIN += $(SGXLKL_CFLAGS_EXTRA) -DSGXLKL_VERSION=\"$(SGXLKL_VERSION)\" -DSGXLKL_GIT_COMMIT=\"$(SGXLKL_GIT_COMMIT)\" -DLKL_VERSION=\"$(LKL_VERSION)\"

# Copied from sgx-lkl-musl/config.mak after ./configure
# TODO: Do not hardcode cflags here
Expand Down
6 changes: 3 additions & 3 deletions src/main-oe/sgxlkl_run_oe.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#define BUILD_INFO "[NON-RELEASE build (-O3)]"
#endif

#define SGXLKL_INFO_STRING "SGX-LKL (OE) Git version %s LKL version %s %s"
#define SGXLKL_INFO_STRING "SGX-LKL (OE) %s (%s) LKL %s %s"
#define SGXLKL_LAUNCHER_NAME "sgx-lkl-run-oe"

// One first empty block for bootloaders, and offset in second block
Expand Down Expand Up @@ -108,7 +108,7 @@ __gdb_hook_starter_ready(void* base_addr, int mode, char* libsgxlkl_path)

static void version()
{
printf(SGXLKL_INFO_STRING, GIT_VERSION, LKL_VERSION, BUILD_INFO);
printf(SGXLKL_INFO_STRING, SGXLKL_VERSION, SGXLKL_GIT_COMMIT, LKL_VERSION, BUILD_INFO);
printf("\n");
}

Expand Down Expand Up @@ -1695,7 +1695,7 @@ int main(int argc, char* argv[], char* envp[])
}

sgxlkl_host_verbose(
SGXLKL_INFO_STRING, GIT_VERSION, LKL_VERSION, BUILD_INFO);
SGXLKL_INFO_STRING, SGXLKL_VERSION, SGXLKL_GIT_COMMIT, LKL_VERSION, BUILD_INFO);
sgxlkl_host_verbose_raw(
encl.mode == SW_DEBUG_MODE
? " [SOFTWARE DEBUG]\n"
Expand Down
4 changes: 2 additions & 2 deletions tests/basic/print_lkl_version/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ $(DISK_IMAGE):
${SGXLKL_DISK_TOOL} create --size=${IMAGE_SIZE} --alpine="busybox" ${DISK_IMAGE}

run-hw: $(DISK_IMAGE)
@(${SGXLKL_ENV} ${SGXLKL_STARTER} --hw-debug ${DISK_IMAGE} /bin/uname -a 2>&1 | grep -E 'LKL version \S+') && echo "TEST PASSED (found LKL version string)"
@(${SGXLKL_ENV} ${SGXLKL_STARTER} --hw-debug ${DISK_IMAGE} /bin/uname -a 2>&1 | grep -E ' LKL \S+') && echo "TEST PASSED (found LKL version string)"

run-sw: $(DISK_IMAGE)
@(${SGXLKL_ENV} ${SGXLKL_STARTER} --sw-debug ${DISK_IMAGE} /bin/uname -a 2>&1 | grep -E 'LKL version \S+') && echo "TEST PASSED (found LKL version string)"
@(${SGXLKL_ENV} ${SGXLKL_STARTER} --sw-debug ${DISK_IMAGE} /bin/uname -a 2>&1 | grep -E ' LKL \S+') && echo "TEST PASSED (found LKL version string)"

clean:
rm -f $(DISK_IMAGE)