-
Notifications
You must be signed in to change notification settings - Fork 106
kernelci: kbuild: transition to available
state when complete
#2882
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# SPDX-License-Identifier: LGPL-2.1-or-later | ||
# | ||
# Copyright (C) 2023 Collabora Limited | ||
# Author: Denys Fedoryshchenko <[email protected]> | ||
|
@@ -24,6 +24,7 @@ | |
- kselftest: false - do not build kselftest | ||
""" | ||
|
||
from datetime import datetime, timedelta | ||
import os | ||
import sys | ||
import re | ||
|
@@ -40,16 +41,16 @@ | |
|
||
|
||
CIP_CONFIG_URL = \ | ||
"https://gitlab.com/cip-project/cip-kernel/cip-kernel-config/-/raw/master/{branch}/{config}" # noqa | ||
CROS_CONFIG_URL = \ | ||
"https://chromium.googlesource.com/chromiumos/third_party/kernel/+archive/refs/heads/{branch}/chromeos/config.tar.gz" # noqa | ||
LEGACY_CONFIG = [ | ||
'config/core/build-configs.yaml', | ||
'/etc/kernelci/core/build-configs.yaml', | ||
] | ||
FW_GIT = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" # noqa | ||
|
||
# TODO: find a way to automatically fetch this information | ||
LATEST_LTS_MAJOR = 6 | ||
LATEST_LTS_MINOR = 6 | ||
|
||
|
@@ -112,13 +113,13 @@ | |
except requests.exceptions.RequestException as e: | ||
print(f"[_download_file_inner] Error: {e}") | ||
return False | ||
except requests.exceptions.Timeout as e: | ||
print(f"[_download_file_inner] Timeout: {e}") | ||
return False | ||
except requests.exceptions.ConnectionError as e: | ||
print(f"[_download_file_inner] Connection error: {e}") | ||
return False | ||
except Exception as e: | ||
print(f"[_download_file_inner] Exception: {e}") | ||
return False | ||
if r.status_code == 200: | ||
|
@@ -570,7 +571,7 @@ | |
elif fragment.startswith("CONFIG_"): | ||
content = fragment + '\n' | ||
else: | ||
# TODO: implement 'path' option properly | ||
content = self.add_legacy_fragment(fragment) | ||
|
||
fragfile = os.path.join(self._fragments_dir, f"{num}.config") | ||
|
@@ -620,8 +621,8 @@ | |
for i in range(0, fragnum): | ||
self.addcmd("./scripts/kconfig/merge_config.sh" + | ||
f" -m .config {self._fragments_dir}/{i}.config") | ||
# TODO: olddefconfig should be optional/configurable | ||
# TODO: log all warnings/errors of olddefconfig to separate file | ||
self.addcmd("make olddefconfig") | ||
self.addcmd(f"cp .config {self._af_dir}/") | ||
self.addcmd("cd ..") | ||
|
@@ -634,7 +635,7 @@ | |
fragnum = self._parse_fragments(firmware=True) | ||
self._merge_frags(fragnum) | ||
if not self._dtbs_check: | ||
# TODO: verify if CONFIG_EXTRA_FIRMWARE have any files | ||
# We can check that if fragments have CONFIG_EXTRA_FIRMWARE | ||
self._fetch_firmware() | ||
self._build_kernel() | ||
|
@@ -890,7 +891,7 @@ | |
''' | ||
Upload artifacts to storage | ||
''' | ||
# TODO: Upload not using upload_single, but upload as multiple files | ||
print("[_upload_artifacts] Uploading artifacts to storage") | ||
node_af = {} | ||
storage = self._get_storage() | ||
|
@@ -978,7 +979,7 @@ | |
api.node.update(node) | ||
except requests.exceptions.HTTPError as err: | ||
err_msg = json.loads(err.response.content).get("detail", []) | ||
self.log.error(err_msg) | ||
return | ||
|
||
def submit(self, retcode, dry_run=False): | ||
|
@@ -1058,12 +1059,18 @@ | |
kselftest_result = 'pass' | ||
break | ||
|
||
if job_result == 'pass': | ||
job_state = 'available' | ||
else: | ||
job_state = 'done' | ||
|
||
results = { | ||
'node': { | ||
'name': self._apijobname, | ||
'result': job_result, | ||
'state': 'done', | ||
'state': job_state, | ||
'artifacts': af_uri, | ||
'holdoff': str(datetime.utcnow() + timedelta(minutes=10)), | ||
}, | ||
'child_nodes': [] | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.