Skip to content

Commit

Permalink
Merge pull request #1 from LIS/master
Browse files Browse the repository at this point in the history
rebase
  • Loading branch information
vyadavmsft authored Sep 19, 2018
2 parents f98e910 + fb410cb commit 019c113
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 85 deletions.
57 changes: 56 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pipeline {
choice(choices: 'Ubuntu_16.04.5\nCentOS_7.4', description: 'Distro version.', name: 'DISTRO_VERSION')
choice(choices: "kernel_pipeline_bvt.xml\nkernel_pipeline_fvt.xml\ntest_kernel_pipeline.xml", description: 'Which tests should LISA run', name: 'LISA_TEST_XML')
choice(choices: 'False\nTrue', description: 'Enable kernel debug', name: 'KERNEL_DEBUG')
string(defaultValue: "build_artifacts, publish_temp_artifacts, boot_test, publish_artifacts, publish_vhd, publish_azure_vhd, publish_hyperv_vhd, validation_functional_hyperv, validation_functional_azure, validation_perf_azure, validation_perf_hyperv",
string(defaultValue: "build_artifacts, publish_temp_artifacts, boot_test, publish_artifacts, publish_vhd, publish_azure_vhd, publish_hyperv_vhd, validation_functional_hyperv, validation_functional_jessie_hyperv, validation_functional_azure, validation_perf_azure, validation_perf_hyperv",
description: 'What stages to run', name: 'ENABLED_STAGES')
}
environment {
Expand Down Expand Up @@ -449,6 +449,61 @@ pipeline {
}
}
}
stage('validation_functional_jessie_hyperv') {
when {
beforeAgent true
expression { params.DISTRO_VERSION.toLowerCase().contains('ubuntu') }
expression { params.ENABLED_STAGES.contains('validation_functional_jessie_hyperv') }
}
agent {
node {
label 'hyper-v'
}
}
steps {
withCredentials(bindings: [string(credentialsId: 'LISA_IMAGES_SHARE_URL', variable: 'LISA_IMAGES_SHARE_URL'),
string(credentialsId: 'AZURE_SAS', variable: 'AZURE_SAS'),
string(credentialsId: 'AZURE_STORAGE_URL', variable: 'AZURE_STORAGE_URL'),
string(credentialsId: 'LISA_TEST_DEPENDENCIES', variable: 'LISA_TEST_DEPENDENCIES'),
string(credentialsId: 'DB_CONFIG_KERNEL', variable: 'DB_CONFIG_KERNEL'),
string(credentialsId: 'LISA_KERNEL_LOG_DESTINATION', variable: 'LISA_KERNEL_LOG_DESTINATION'),
file(credentialsId: 'KERNEL_QUALITY_REPORTING_DB_CONFIG',
variable: 'DBConfigPath')]) {
echo 'Running LISA for Debian Jessie...'
dir('kernel_version' + env.BUILD_NUMBER + env.BRANCH_NAME) {
unstash 'kernel_version_ini'
PowerShellWrapper('cat scripts/package_building/kernel_versions.ini')
}
PowerShellWrapper('''
& ".\\scripts\\lis_hyperv_platform\\main.ps1"
-KernelVersionPath "kernel_version${env:BUILD_NUMBER}${env:BRANCH_NAME}\\scripts\\package_building\\kernel_versions.ini"
-JobId "${env:BUILD_NAME}${env:BUILD_NUMBER}${env:BRANCH_NAME}jessie"
-InstanceName "${env:BUILD_NAME}${env:BUILD_NUMBER}${env:BRANCH_NAME}jessie"
-VHDType "Debian" -OSVersion "8.11" -WorkingDirectory "C:\\workspace"
-LISAImagesShareUrl "${env:LISA_IMAGES_SHARE_URL}" -XmlTest "${env:LISA_TEST_XML}"
-AzureToken "${env:AZURE_SAS}" -AzureUrl "${env:AZURE_STORAGE_URL}${env:KERNEL_GIT_BRANCH_LABEL}-kernels"
-LisaTestDependencies "${env:LISA_TEST_DEPENDENCIES}"
-PipelineName "pipeline-msft-kernel-validation/${env:BRANCH_NAME}"
-DBConfigPath "${env:DBConfigPath}"
-LisaLogDBConfigPath "${env:DB_CONFIG_KERNEL}"
-LogsPath "${env:LISA_KERNEL_LOG_DESTINATION}"
''')
echo 'Finished running LISA for Debian Jessie.'
}
}
post {
always {
archiveArtifacts "${BUILD_NAME}${BUILD_NUMBER}${BRANCH_NAME}jessie\\TestResults\\**\\*"
junit "${BUILD_NAME}${BUILD_NUMBER}${BRANCH_NAME}jessie\\TestResults\\**\\*.xml"
}
success {
echo 'Cleaning up LISA environment...'
PowerShellWrapper('''
& ".\\scripts\\lis_hyperv_platform\\tear_down_env.ps1" -InstanceName "${env:BUILD_NAME}${env:BUILD_NUMBER}${env:BRANCH_NAME}jessie"
''')
}
}
}
stage('validation_functional_azure') {
when {
beforeAgent true
Expand Down
105 changes: 67 additions & 38 deletions linux_pipeline/Jenkinsfile_container_images
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def PowerShellWrapper(psCmd) {
}

properties ([
pipelineTriggers([cron('H * * * *')]),
[$class: 'ParametersDefinitionProperty',
parameterDefinitions: [
[$class: 'StringParameterDefinition',
Expand All @@ -16,10 +17,22 @@ properties ([
name: 'INITRD_URL',
defaultValue: "",
description: 'Url to the initrd to be tested'],
[$class: 'StringParameterDefinition',
name: 'TESTS',
defaultValue: "linuxkit,opengcs_build,docker_stress,kernel_builder",
description: 'Tests to be run'],
[$class: 'BooleanParameterDefinition',
defaultValue: true,
description: 'Run full linuxkit test suite',
name: 'linuxkit'],
[$class: 'BooleanParameterDefinition',
defaultValue: true,
description: 'Run docker-stress test',
name: 'docker_stress'],
[$class: 'BooleanParameterDefinition',
defaultValue: true,
description: 'Build latest opengcs from github',
name: 'opengcs_build'],
[$class: 'BooleanParameterDefinition',
defaultValue: true,
description: 'Build kernel in docker container',
name: 'kernel_builder'],
[$class: 'StringParameterDefinition',
name: 'HOST_VERSION',
defaultValue: "RS4",
Expand All @@ -28,6 +41,7 @@ properties ([
]
])

env.LAST_VERSION_FILE = "C:\\LCOW_LATEST_VERSION.txt"
env.ARTIFATCS_DESTINATION = "C:\\Program Files\\Linux Containers"
env.BINARIES_DESTINATION = "C:\\lcow-bin"
env.LINUXKIT_REPO = "https://github.com/linuxkit/lcow"
Expand All @@ -42,18 +56,17 @@ env.DOCKER_KERNEL_BUILDER_BRANCH = "master"
versionsMap = ["RS4":"lcow-win-rs4"]
testMap = ["test_functional":"linuxkit","test_stress":"docker_stress,opengcs_build,kernel_builder"]
def hostName = versionsMap[env.HOST_VERSION]
skipBuild = false

def runTests(versionsMap, hostName){
def testNames = env.TESTS.split(",")

testMap.keySet().each {
def section = it
def sectionTests = testMap[section].split(",")

stage (section) {
def runs = [:]
sectionTests.each {
if (testNames.contains(it)) {
if (env[it] == "true") {
runs[it] = {
node (hostName) {
runTestStage(it)
Expand Down Expand Up @@ -155,54 +168,70 @@ def runStressTest() {


stage ("check_kernel") {
node ("ws2016") {
withCredentials(bindings: [string(credentialsId: 'TEST_ARTIFACTS_PATH', variable: 'TEST_ARTIFACTS_PATH')]) {
node (hostName) {
withCredentials(bindings: [string(credentialsId: 'LCOW_STORAGE_ACCOUNT', variable: 'STORAGE_ACCOUNT'),
string(credentialsId: 'LCOW_STORAGE_KEY', variable: 'STORAGE_KEY'),
string(credentialsId: 'LCOW_CONTAINER_NAME', variable: 'CONTAINER_NAME')]) {
dir ("lcow-artifacts-${env.BUILD_NUMBER}-${env.BRANCH_NAME}") {
checkout scm
PowerShellWrapper('''
& ".\\scripts\\lcow\\Copy-Artifacts.ps1"
& ".\\scripts\\lcow\\Get-Artifacts.ps1"
-StorageAccName "${env:STORAGE_ACCOUNT}"
-StorageAccKey "${env:STORAGE_KEY}"
-ContainerName "${env:CONTAINER_NAME}"
-LastVersionFile "${env:LAST_VERSION_FILE}"
-KernelUrl "${env:KERNEL_URL}"
-InitrdUrl "${env:INITRD_URL}"
-Destination ".\\lcow-artifacts"
''')
stash includes: 'lcow-artifacts\\*', name: 'lcow_artifacts'

buildName = readFile "./build_name"
if (buildName != "" ) {
currentBuild.displayName = buildName + "-${env.BUILD_NUMBER}"
stash includes: 'lcow-artifacts\\*', name: 'lcow_artifacts'
} else {
echo "No new artifacts found"
skipBuild = true
}
deleteDir()
}
}
}
}

stage ("prepare_env") {
node (hostName) {
dir ("lcow-prepare-${env.BUILD_NUMBER}-${env.BRANCH_NAME}") {
checkout scm
echo "Preparing the host:${hostName} for testing"
unstash 'lcow_artifacts'
PowerShellWrapper('''
& ".\\scripts\\lcow\\Prepare-Env.ps1"
-BinariesDestination "${env:BINARIES_DESTINATION}"
-ArtifactsPath ".\\lcow-artifacts"
-ArtifactsDestination "${env:ARTIFATCS_DESTINATION}"
''')
deleteDir()
if (!skipBuild) {
stage ("prepare_env") {
node (hostName) {
dir ("lcow-prepare-${env.BUILD_NUMBER}-${env.BRANCH_NAME}") {
checkout scm
echo "Preparing the host:${hostName} for testing"
unstash 'lcow_artifacts'
PowerShellWrapper('''
& ".\\scripts\\lcow\\Prepare-Env.ps1"
-BinariesDestination "${env:BINARIES_DESTINATION}"
-ArtifactsPath ".\\lcow-artifacts"
-ArtifactsDestination "${env:ARTIFATCS_DESTINATION}"
''')
deleteDir()
}
}
}
}

runTests(versionsMap, hostName)
runTests(versionsMap, hostName)

stage ("clear_env") {
node (hostName) {
dir ("lcow-prepare-${env.BUILD_NUMBER}-${env.BRANCH_NAME}") {
checkout scm
echo "Cleaning host:${hostName} after testing"
PowerShellWrapper('''
& ".\\scripts\\lcow\\Clear-Env.ps1"
-BinariesPath "${env:BINARIES_DESTINATION}"
-ArtifactsPath "${env:ARTIFATCS_DESTINATION}"
-DockerdPath "C:\\Docker-Workspace"
''')
deleteDir()
stage ("clear_env") {
node (hostName) {
dir ("lcow-prepare-${env.BUILD_NUMBER}-${env.BRANCH_NAME}") {
checkout scm
echo "Cleaning host:${hostName} after testing"
PowerShellWrapper('''
& ".\\scripts\\lcow\\Clear-Env.ps1"
-BinariesPath "${env:BINARIES_DESTINATION}"
-ArtifactsPath "${env:ARTIFATCS_DESTINATION}"
-DockerdPath "C:\\Docker-Workspace"
''')
deleteDir()
}
}
}
}
30 changes: 0 additions & 30 deletions scripts/lcow/Copy-Artifacts.ps1

This file was deleted.

Loading

0 comments on commit 019c113

Please sign in to comment.