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 Windows Min Artifacts Building on Jenkins #2483

Merged
Show file tree
Hide file tree
Changes from 6 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
31 changes: 31 additions & 0 deletions jenkins/opensearch/distribution-build.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,37 @@ pipeline {
}
}
}
stage('build-snapshot-windows-x64-tar') {
agent {
node {
label 'Jenkins-Agent-Windows2019-X64-C54xlarge-Single-Host'
}
}
tools {
jdk dockerAgent.javaVersion
}
steps {
script {
buildManifest(
componentName: "${COMPONENT_NAME}",
inputManifest: "manifests/${INPUT_MANIFEST}",
distribution: 'zip',
platform: 'windows',
snapshot: true
)
echo("Uploading windows min snapshots to S3")
uploadMinSnapshotsToS3(
fileActions: [createSha512Checksums()],
distribution: 'zip'
)
}
}
post {
always {
postCleanup()
}
}
}
stage('build-and-test-x64-tar') {
agent {
docker {
Expand Down
19 changes: 15 additions & 4 deletions src/system/temporary_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.

import errno
import logging
import os
import shutil
Expand All @@ -17,9 +16,21 @@

def g__handleRemoveReadonly(func: FunctionType, path: str, exc: Any) -> Any:
excvalue = exc[1]
if func in (os.rmdir, os.remove, os.unlink) and excvalue.errno == errno.EACCES:
os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) # 0777
func(path)
logging.debug(f"excvalue {excvalue}")
logging.debug(f"func {func.__name__}")
if func in (os.rmdir, os.remove, os.unlink):
os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO | stat.S_IWRITE | stat.S_IREAD) # 0777 nix* / +wr windows
try_total = 3
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
for try_count in range(try_total): # Re-run func to force deletion especially on windows
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
try:
logging.debug(f'Try count: {try_count + 1}/{try_total}')
func_result = None
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
func_result = func(path)
if func_result is None:
break
except Exception as ex:
logging.debug(func_result)
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
logging.debug(ex)
else:
raise

Expand Down