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

update fork #4

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4671222
[CPU] Add workaround for Ngraph OPs friendly name initialization (#5916)
EgorDuplensky Jun 1, 2021
0350dfe
delete wrong spec for RNNCell (#5117)
itikhono Jun 1, 2021
42afbfb
[IE][VPU] Temporary fix for conformance tests (#5867)
Jun 1, 2021
de8742a
[CPU] Reduce node fix illegal instruction on sse41 (#5782)
xuchen-intel Jun 1, 2021
e803d1a
Moved CC macros to public API (#5929)
ilyachur Jun 1, 2021
26e802a
[CPU] Fix eltwise precision fusing on non-zero ports (#5934)
IvanNovoselov Jun 1, 2021
d65778b
Fixed templatePlugin tests on IA32 (#5901)
ilya-lavrenov Jun 1, 2021
7a239c3
[docs] corrected link in one billion convert doc, added DEPRECATED to…
pavel-esir Jun 1, 2021
d40636f
LRN operation specification refactoring (#5890)
jdanieck Jun 1, 2021
b2abf25
Python speech sample (#5322)
dpigasin Jun 1, 2021
c980a0b
[LPT] SplitTransformation WA for unsupported concat (#5833)
v-Golubev Jun 1, 2021
45ce06c
CTCGreedyDecoder operation specification refactoring (#5885)
jdanieck Jun 1, 2021
07085de
Fix for data race in MKLDNNSharedMemory::valid (#5910)
vladislav-volkov Jun 1, 2021
eff9f00
Refactored ie_plugin_config.hpp (#5899)
ilya-lavrenov Jun 1, 2021
28c10b1
[CPU] Fix mem leak in ParameterResultCustomBlobTest (#5933)
maxnick Jun 1, 2021
22881ae
[LPT] ConvolutionTransformation with asymmetric quantization after Sp…
v-Golubev Jun 1, 2021
6bf7ed8
Azure CI: Add "Build samples" check (#5954)
Jun 1, 2021
1264376
[CPU] Extended preprocessing for CPU (#5750)
yury-intel Jun 1, 2021
04b1f22
[LPT] ConvolutionBackpropData Transformation fix (#5924)
v-Golubev Jun 1, 2021
d49f17e
[GNA] Fix PWL segment creation condition (#5906)
sirzabek Jun 1, 2021
53ca9b2
Windows build fix against prebuilt package (#5957)
ilya-lavrenov Jun 1, 2021
6589f0a
scripts: remove pot dependencies (#5956)
generalova-kate Jun 1, 2021
5765a7e
NGraph FrontEnd Manager - Basic API (#5470)
nosovmik Jun 1, 2021
677cf16
[IE Caching] fix klocwork warnings (#5973)
nosovmik Jun 1, 2021
9970f5b
Interpolate operation specification refactoring. (#5928)
jdanieck Jun 2, 2021
143fc06
Fix 'operands of different size in bitwise operation' klockwork issue…
jdanieck Jun 2, 2021
f882229
[MO] Add extractor for ONNX *OrEqual operations (#5932)
Jun 2, 2021
4b486e6
[GNA] Fix fq weights fusion and relu scale factors calculation (#5886)
elilobanova Jun 2, 2021
662a8e6
Remove redundant constructor_validate_and_infer_types() calls. (#5832)
sdurawa Jun 2, 2021
c9e83c2
Update AUTO plugin capabilities implementation (#5757)
mashoujiang Jun 2, 2021
0f6f09b
Gna revert padded to valid convolution and 2d convolution decompositi…
sirzabek Jun 2, 2021
df33138
Fixed get_all_data_elements_bitwise_identical() method (#5873)
ilyachur Jun 2, 2021
bcdd915
[IE TESTS] Add Conformance mode (test counters alignment between plug…
iefode Jun 2, 2021
34b02a5
Fixed KW issues (#5977)
ilyachur Jun 2, 2021
c77a13a
Add support for SparseTensor in Constant op (#5871)
Jun 2, 2021
3bb91c4
Fix of some nGraph python tests (#5778)
Jun 2, 2021
3c9092f
[IE CLDNN] Fix klocwork issue (#5942)
Jun 2, 2021
5f54ec5
[Spec] Prelu - Remove 1D slope restriction and update broadcast info …
mitruska Jun 2, 2021
02e92c0
Add missing inputs for ActivationParamLayerTest. (#5714)
XinWangIntel Jun 2, 2021
487faf3
Fix 56171: Insert AffineFilter after split when padding is needed. Fi…
nkogteva Jun 2, 2021
c77b4dc
[IE TESTS] Incorrect calculation for 'Convert' number of test crashes…
nsemaev Jun 2, 2021
f28c8b1
do not move temporary object (#5962)
Jun 2, 2021
2ca8dcb
Azure CI: Change IB install url to a static web (#5999)
Jun 2, 2021
09c2cbf
Fix adding dummy data for models with multiple inputs (#5984)
dpigasin Jun 2, 2021
ac4dd6c
Refactor `while True` loops (#5952)
dpigasin Jun 2, 2021
9fe2870
Fix YOLACT documentation (#5990)
mvafin Jun 2, 2021
565e5cf
Fix QuartzNet documentation (#5987)
mvafin Jun 2, 2021
e7e8c4b
[IE PYTHON] Fix memory leak in IENetwork's constructor (#5856)
Jun 2, 2021
ac1803c
Fix python benchmark_app hanging on faster rcnn (#6003)
nkogteva Jun 2, 2021
d56cf51
Reshape should support reshape to zero shapes (#5828)
ilyachur Jun 3, 2021
e562273
Exposing 'Dimension' class to Python nGraph API (#5997)
nosovmik Jun 3, 2021
229cf10
[CPU] Memory leak in jit_uni_fork_softmax kernel (#5947)
vladislav-volkov Jun 3, 2021
ebe5349
[IE CLDNN] Binary convolution fsv16 kernel: eltwise fusing improvemen…
lznamens Jun 3, 2021
968888b
doc: add link to docker tutorials (#5960)
generalova-kate Jun 3, 2021
63a335f
[Speech sample] Added numpy array support (#5479)
Jun 3, 2021
dd62a25
Fix weights compression (#6007)
Jun 3, 2021
1140013
Developer package update (#5970)
ilya-lavrenov Jun 3, 2021
b2a6cef
Negate, Divide and Subtract conversion adopted for scalar case (#6008)
Jun 3, 2021
5494280
Gather->ShapeOf optimization fix (#6006)
Jun 3, 2021
5f3144c
Enable make clean to remove ie_wheel artifacts (#5961)
slyubimt Jun 3, 2021
9384cfe
Revise NonZero op - specification (#5804)
Jun 3, 2021
3825e90
Fix of RollWithEmptyAxesReplacer transformation. (#5937)
popovaan Jun 3, 2021
fdf47d4
[CPU] Enable GroupDeconvolution tests back (#5878)
EgorDuplensky Jun 3, 2021
9de75d9
[Doc] Update the driver link to storage.openvinotoolkit.org (#6021)
dorloff Jun 3, 2021
5c716d2
ConvertMinimum adjusted to handle scalar input correctly (#6017)
Jun 3, 2021
291a80c
Make stress and time tests build dependent from gflags from samples (…
vurusovs Jun 4, 2021
5e8d1cc
Implement Einsum reference in nGraph interpreter (#5923)
rkazants Jun 4, 2021
90a93be
Add transformations to optimize SR model (#5854)
mvafin Jun 4, 2021
d3a5c67
[IE CLDNN] crop + NMS should not be merged because optimizing out cro…
yeonbok Jun 4, 2021
563a095
[IE CLDNN] Fix performance degradation on yolo models (#5876)
amolotko Jun 4, 2021
126d1a6
CI: Update org control scripts (#6035)
Jun 4, 2021
b1257a5
[CPU] fix load time for several models (#5958)
Jun 4, 2021
b8b6b4d
[CPU] Reduced number of tests for BatchToSpace and SpaceToBatch (#5385)
Jun 4, 2021
81be8c9
[CPU] Deconvolution int8 fusing support (#5683)
antonvor Jun 4, 2021
859a3b8
Deprecated warnings fix in MO (#6016)
evolosen Jun 4, 2021
0db9d3e
Added extractor for ONNX operation Size (#6031)
lazarevevgeny Jun 4, 2021
62c37a8
[CPU] Dynamic shape support for MKLDNNMVNNode::isSupportedOperation (…
Jun 4, 2021
0681192
[LPT] Klocwork fixes (#5981)
v-Golubev Jun 4, 2021
d9d63d0
[MO] fix MarkNodesWithShapeValues (#5808)
pavel-esir Jun 4, 2021
9b16faf
Gna fix sca issues (#5992)
sirzabek Jun 4, 2021
adee522
GitHub CI: Disable doc build on forks and upload on PR (#6044)
Jun 4, 2021
149c430
Set less strict numpy requirements (#6039)
ilya-naumov Jun 4, 2021
46bef80
Fix ConvertPrecision for Constants (#6041)
Jun 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 14 additions & 1 deletion .ci/azure/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
MODELS_PATH: $(REPO_DIR)/../testdata
WORK_DIR: $(Pipeline.Workspace)/_w
BUILD_DIR: $(WORK_DIR)/build
BUILD_SAMPLES_DIR: $(WORK_DIR)/build_samples
BIN_DIR: $(REPO_DIR)/bin/intel64/$(BUILD_TYPE)
INSTALL_DIR: $(WORK_DIR)/install_pkg
SETUPVARS: $(INSTALL_DIR)/bin/setupvars.sh
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
- script: |
rm -rf $(WORK_DIR) ; mkdir $(WORK_DIR)
rm -rf $(BUILD_DIR) ; mkdir $(BUILD_DIR)
rm -rf $(BUILD_SAMPLES_DIR) ; mkdir $(BUILD_SAMPLES_DIR)
echo TargetBranch: $(System.PullRequest.TargetBranch)
echo SourceBranch: $(Build.SourceBranch)
displayName: 'Make dir'
Expand Down Expand Up @@ -117,12 +119,23 @@ jobs:
displayName: 'Build Lin'

- script: ls -alR $(REPO_DIR)/bin/
displayName: 'List files'
displayName: 'List bin files'

- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
workingDirectory: $(BUILD_DIR)
displayName: 'Install'

- script: ls -alR $(INSTALL_DIR)
displayName: 'List install files'

- script: $(INSTALL_DIR)/deployment_tools/inference_engine/samples/cpp/build_samples.sh
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build cpp samples'

- script: $(INSTALL_DIR)/deployment_tools/inference_engine/samples/c/build_samples.sh
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build c samples'

- script: $(BIN_DIR)/unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
displayName: 'nGraph UT'
continueOnError: false
Expand Down
17 changes: 15 additions & 2 deletions .ci/azure/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
MODELS_PATH: $(REPO_DIR)\..\testdata
WORK_DIR: $(Pipeline.Workspace)\_w
BUILD_DIR: D:\build
BUILD_SAMPLES_DIR: D:\build_samples
BIN_DIR: $(REPO_DIR)\bin\intel64
MSVS_VARS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat
MSVC_COMPILER_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.24.28314\bin\Hostx64\x64\cl.exe
Expand Down Expand Up @@ -56,10 +57,11 @@ jobs:
- script: |
rd /Q /S $(WORK_DIR) & mkdir $(WORK_DIR)
rd /Q /S $(BUILD_DIR) & mkdir $(BUILD_DIR)
rd /Q /S $(BUILD_SAMPLES_DIR) & mkdir $(BUILD_SAMPLES_DIR)
displayName: 'Make dir'

- script: |
certutil -urlcache -split -f https://incredibuilddiag1wu2.blob.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
certutil -urlcache -split -f https://openvinoweb.z5.web.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
call install_ib_console.bat
workingDirectory: $(WORK_DIR)
displayName: 'Install IncrediBuild'
Expand Down Expand Up @@ -101,12 +103,23 @@ jobs:
displayName: 'Build Win'

- script: dir $(REPO_DIR)\bin\ /s
displayName: 'List files'
displayName: 'List bin files'

- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake
workingDirectory: $(BUILD_DIR)
displayName: 'Install'

- script: dir $(INSTALL_DIR) /s
displayName: 'List install files'

- script: $(INSTALL_DIR)\deployment_tools\inference_engine\samples\cpp\build_samples_msvc.bat
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build cpp samples'

- script: $(INSTALL_DIR)\deployment_tools\inference_engine\samples\c\build_samples_msvc.bat
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build c samples'

- script: |
set PATH=$(TEST_ENV_PATH)
$(BIN_DIR)\unit-test --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml
Expand Down
2 changes: 1 addition & 1 deletion .ci/azure/windows_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
displayName: 'Make dir'

- script: |
certutil -urlcache -split -f https://incredibuilddiag1wu2.blob.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
certutil -urlcache -split -f https://openvinoweb.z5.web.core.windows.net/incredibuild/install_ib_console.bat install_ib_console.bat
call install_ib_console.bat
workingDirectory: $(WORK_DIR)
displayName: 'Install IncrediBuild'
Expand Down
3 changes: 0 additions & 3 deletions .github/org_control/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

75 changes: 59 additions & 16 deletions .github/org_control/check_org.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
Check GitHub organization and invite members
"""

# pylint: disable=fixme,no-member
# pylint: disable=fixme,no-member,too-many-locals

from argparse import ArgumentParser

import github_api
from configs import Config
from github_api import GithubOrgApi, get_dev_emails
from ldap_api import LdapApi, print_user_info, InfoLevel


def main():
Expand All @@ -19,32 +20,74 @@ def main():
arg_parser.add_argument("--cfg-file", metavar="PATH", default=Config.default_cfg_path,
help=f"Path to json configuration file, e.g. {Config.default_cfg_path}")
arg_parser.add_argument("--teams", action="store_true", help="Check GitHub teams")
arg_parser.add_argument("--no-ldap", action="store_true", help="Don't use LDAP info")
args, unknown_args = arg_parser.parse_known_args()

Config(args.cfg_file, unknown_args)
gh_api = github_api.GithubOrgApi()
gh_api = GithubOrgApi()

if args.teams:
gh_api.get_org_teams()
else:
dev_emails = github_api.get_dev_emails()
print(f'\nDeveloper emails {len(dev_emails)}:', '; '.join(dev_emails))
return

org_emails = gh_api.get_org_emails()
print(f'\nOrg emails {len(org_emails)}:', '; '.join(org_emails))
cfg_emails = get_dev_emails()
print(f'\nCfg developer emails {len(cfg_emails)}:', '; '.join(sorted(cfg_emails)))

org_pendig_invitation_emails = gh_api.get_org_invitation_emails()
dev_emails = set()
dev_emails.update(cfg_emails)

invite_emails = dev_emails.difference(org_emails).difference(org_pendig_invitation_emails)
print(f'\nInvite emails {len(invite_emails)}:', '; '.join(invite_emails))
if not args.no_ldap:
ldap_api = LdapApi()
ldap_emails = ldap_api.get_user_emails()
dev_emails.update(ldap_emails)
print(f'\nLDAP developer emails {len(ldap_emails)}:', '; '.join(sorted(ldap_emails)))

no_in_dev_emails = org_emails.difference(dev_emails)
print(f'\nOrg members - no in developers list {len(no_in_dev_emails)}:',
'; '.join(no_in_dev_emails))
cfg_emails_no_in_ldap = ldap_api.get_absent_emails(cfg_emails)
print(f'\nCfg developer emails - absent in LDAP at all {len(cfg_emails_no_in_ldap)}:',
'; '.join(sorted(cfg_emails_no_in_ldap)))

valid_github_users = gh_api.get_valid_github_users(invite_emails)
cfg_ldap_inters = cfg_emails.intersection(ldap_emails)
print(f'\nCfg developer emails - present in LDAP developers {len(cfg_ldap_inters)}:',
'; '.join(sorted(cfg_ldap_inters)))

gh_api.invite_users(valid_github_users)
org_emails, org_logins_no_intel_email = gh_api.get_org_emails()
print(f'\nOrg emails {len(org_emails)}:', '; '.join(sorted(org_emails)))

org_emails_no_in_ldap = set()
if not args.no_ldap:
org_ldap_diff = org_emails.difference(ldap_emails)
print(f'\nOrg member emails - absent in LDAP developers {len(org_ldap_diff)}:',
'; '.join(sorted(org_ldap_diff)))

for email in org_ldap_diff:
user_info = ldap_api.get_user_info_by_email(email)
if user_info:
print_user_info(user_info, InfoLevel.PDL)
else:
org_emails_no_in_ldap.add(email)

org_pendig_invitation_emails = gh_api.get_org_invitation_emails()
invite_emails = dev_emails.difference(org_emails).difference(org_pendig_invitation_emails)
print(f'\nInvite emails {len(invite_emails)}:', '; '.join(sorted(invite_emails)))

valid_github_users = gh_api.get_valid_github_users(invite_emails)
gh_api.invite_users(valid_github_users)

print('\nCheck accounts below and remove from the GitHub organization and cfg list')

cfg_emails_no_in_org = sorted(cfg_emails.difference(org_emails))
print(f'\nCfg developer emails - absent in GitHub organization {len(cfg_emails_no_in_org)}:',
'; '.join(cfg_emails_no_in_org))

org_emails_no_in_dev = sorted(org_emails.difference(dev_emails))
print(f'\nOrg member emails - absent in cfg and LDAP developers {len(org_emails_no_in_dev)}:',
'; '.join(org_emails_no_in_dev))

print(f'\nOrg member emails - absent in LDAP at all {len(org_emails_no_in_ldap)}:',
'; '.join(sorted(org_emails_no_in_ldap)))

print(f'\nOrg member logins - absent Intel email {len(org_logins_no_intel_email)}:',
'; '.join(sorted(org_logins_no_intel_email)))


if __name__ == '__main__':
Expand Down
57 changes: 40 additions & 17 deletions .github/org_control/check_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,23 @@ def get_pr_labels(pull):


def set_pr_labels(pull, labels):
"""Sets PR labels"""
"""Sets new PR labels (all previously set labels are removed)"""
if not labels or Config().DRY_RUN:
return
print(f'Set PR labels:', labels)
print('Set PR labels:', labels)
# set_labels() should accept list but fails with empty "AssertionError:"
pull.set_labels(labels)


def add_pr_labels(pull, labels):
"""Adds PR labels"""
if not labels or Config().DRY_RUN:
return
print('Add PR labels:', labels)
for label in labels:
pull.add_to_labels(label)


def get_pr_type_by_labels(pull):
"""Gets PR type using labels"""
pr_lables = get_pr_labels(pull)
Expand Down Expand Up @@ -80,6 +90,17 @@ def get_category_labels(pull):
return labels


def get_pr_info_str(pull):
"""Gets info about PR using a few workarounds"""
pr_title = pull.title.encode("ASCII", "ignore").decode()

# Workaround for PyGithub issue: https://github.com/PyGithub/PyGithub/issues/512
pr_created_at = pull.created_at.replace(tzinfo=datetime.timezone.utc).astimezone()

return f'PR: {pull.number} - {pr_title} - Created: {pr_created_at} - ' \
f'Labels: {get_pr_labels(pull)} - Type: {get_pr_type_by_labels(pull)}'


def main():
"""The main entry point function"""
arg_parser = ArgumentParser()
Expand All @@ -103,19 +124,19 @@ def main():
print(f'\nPRs count ({args.pr_state}):', pulls.totalCount)

if args.newer:
pr_created_after = datetime.datetime.now() - datetime.timedelta(minutes=int(args.newer))
print('PRs created after:', pr_created_after)
pr_created_after = (datetime.datetime.now() -
datetime.timedelta(minutes=int(args.newer))).astimezone()
print('Checking PRs created after:', pr_created_after)
non_org_intel_pr_users = set()
non_org_pr_users = set()
for pull in pulls:
if args.newer and pull.created_at <= pr_created_after:
print(f'\nIGNORE: {pull} - Created: {pull.created_at}')
pr_created_at = pull.created_at.replace(tzinfo=datetime.timezone.utc).astimezone()
if args.newer and pr_created_at <= pr_created_after:
print(f'\nIGNORE: {get_pr_info_str(pull)}')
continue
pr_lables = get_pr_labels(pull)
pr_type_by_labels = get_pr_type_by_labels(pull)
set_labels = []
print(f'\n{pull} - Created: {pull.created_at} - Labels: {pr_lables} -',
f'Type: {pr_type_by_labels}', end='')
add_labels = []
print(f'\n{get_pr_info_str(pull)}', end='')

# Checks PR source type
if gh_api.is_org_user(pull.user):
Expand All @@ -127,21 +148,23 @@ def main():
if pr_type_by_labels is not PrType.INTEL:
print(f'NO "{PrType.INTEL.value}" label: ', end='')
github_api.print_users(pull.user)
set_labels.append(PrType.INTEL.value)
add_labels.append(PrType.INTEL.value)
elif github_api.is_user_ignored(pull.user):
print(' - IGNORED non org user with NO Intel email or company')
else:
print(f' - Non org user with NO Intel email or company')
print(' - Non org user with NO Intel email or company')
non_org_pr_users.add(pull.user)
if pr_type_by_labels is not PrType.EXTERNAL:
print(f'NO "{PrType.EXTERNAL.value}" label: ', end='')
github_api.print_users(pull.user)
set_labels.append(PrType.EXTERNAL.value)
add_labels.append(PrType.EXTERNAL.value)

set_labels += get_category_labels(pull)
set_pr_labels(pull, set_labels)
add_labels += get_category_labels(pull)
add_pr_labels(pull, add_labels)

print(f'\nNon org user with Intel email or company:')
print('\nNon org user with Intel email or company:')
github_api.print_users(non_org_intel_pr_users)
print(f'\nNon org user with NO Intel email or company:')
print('\nNon org user with NO Intel email or company:')
github_api.print_users(non_org_pr_users)


Expand Down
4 changes: 3 additions & 1 deletion .github/org_control/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"openvino-ci",
"openvino-pushbot",
"lab-nerval",
"lab-nerval-onnx-ci"
"lab-nerval-onnx-ci",
"onnx-watchdog-agent",
"dependabot"
],
"EMAILS_FILE_PATH": "dev_emails-test.txt",
"PROXIES": {
Expand Down
18 changes: 9 additions & 9 deletions .github/org_control/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ def __init__(self, file_path=None, cli_args=None):
for name, value in self._json_cfg.items():
if hasattr(self, name):
raise ConfigException(f'Duplicating prosperity: {name}')
prosperity_value = self._args.get(name) or os.getenv(name)
if prosperity_value:
property_value = self._args.get(name) or os.getenv(name)
if property_value:
# Try to set prosperity_value as Python literal structures, e.g. DRY_RUN=False
try:
prosperity_value = ast.literal_eval(prosperity_value)
property_value = ast.literal_eval(property_value)
except Exception:
pass
if not isinstance(prosperity_value, type(value)):
if not isinstance(property_value, type(value)):
raise ConfigException(f'Python type of {name} parameter must be {type(value)}')
else:
prosperity_value = value
setattr(self, name, prosperity_value)
Config.properties[name] = prosperity_value
property_value = value
setattr(self, name, property_value)
Config.properties[name] = property_value

self.set_proxy()

Expand All @@ -78,7 +78,7 @@ def _load_cfg(self):
try:
with open(self._file_path) as conf:
self._json_cfg = json.load(conf)
except:
except Exception:
print('Failed to load configuration from:', self._file_path)
raise

Expand All @@ -105,7 +105,7 @@ def set_proxy(self):
def _test():
"""Test and debug"""
print('Config.default_cfg_path:', Config.default_cfg_path)
cfg = Config(cli_args=['DRY_RUN=True'])
cfg = Config(cli_args=['DRY_RUN', 'PROXIES={"NO_PROXY": "localhost"}'])
print('Config.properties:', cfg.get_properties())


Expand Down
Loading