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 all 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
18 changes: 14 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,20 @@

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
retry_total = 3
for retry_count in range(retry_total): # Re-run func to force deletion especially on windows
try:
logging.debug(f'Try count: {retry_count + 1}/{retry_total}')
func_result = func(path)
if func_result is None:
break
except Exception as ex:
logging.warn(func_result)
logging.warn(ex)
else:
raise

Expand Down