diff options
author | Daniel Friesel <dfriesel@uos.de> | 2022-05-10 09:25:01 +0000 |
---|---|---|
committer | Daniel Friesel <dfriesel@uos.de> | 2022-05-10 09:25:01 +0000 |
commit | f859cb1fd0c6c5831bf9d8d310a8a94e3ac4996e (patch) | |
tree | 919f2a1daa593e8c178cea56b603a58db25af1bb | |
parent | 4e2fae9399b4c770d2b18775e1b89248966948b9 (diff) | |
parent | cbb34a7ce6f5999fd95ff55672b2ae35aade74de (diff) |
Merge branch 'feature/kconfig-export' into 'master'
CI: Automatically export x264 CART/RMT models
See merge request software/dfatool!1
-rw-r--r-- | .gitlab-ci.yml | 34 | ||||
-rw-r--r-- | lib/loader/kconfig.py | 3 |
2 files changed, 37 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efbf872..1e30111 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,8 @@ image: debian:bullseye stages: - test + - build + - deploy run_tests: stage: test @@ -35,3 +37,35 @@ run_tests: paths: - htmlcov/ expire_in: 1 week + +make_model: + stage: build + variables: + GIT_SUBMODULE_STRATEGY: normal + script: + - apt-get update -qy + - apt-get install -y python3-dev python3-coverage python3-frozendict python3-numpy python3-scipy python3-sklearn python3-yaml python3-zbar wget + - wget -q https://ess.cs.uos.de/.private/dfatool/multipass.json.xz https://ess.cs.uos.de/.private/dfatool/multipass.kconfig + - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py multipass.kconfig multipass.json.xz --export-webconf multipass-rmt.json + - wget -q https://ess.cs.uos.de/.private/dfatool/x264.json.xz https://ess.cs.uos.de/.private/dfatool/x264.kconfig https://ess.cs.uos.de/.private/dfatool/x264.nfpkeys.json + - mv x264.nfpkeys.json nfpkeys.json + - DFATOOL_DTREE_SKLEARN_CART=1 DFATOOL_PARAM_CATEGORIAL_TO_SCALAR=1 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf x264-cart.json + - DFATOOL_DTREE_IGNORE_IRRELEVANT_PARAMS=0 bin/analyze-kconfig.py x264.kconfig x264.json.xz --export-webconf x264-rmt.json + artifacts: + paths: + - multipass-rmt.json + - x264.kconfig + - x264-cart.json + - x264-rmt.json + +deploy_model: + stage: deploy + before_script: + - apt-get -y update + - apt-get -y install lftp + - mkdir -p ~/.ssh + - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + - chmod 600 "$STAGING_PRIVATE_KEY" + script: + - lftp -e "set sftp:connect-program 'ssh -a -x -i $STAGING_PRIVATE_KEY'; mkdir -p -f /dfatool/$CI_COMMIT_REF_NAME; put -e -O dfatool/$CI_COMMIT_REF_NAME x264.kconfig x264-cart.json x264-rmt.json; quit" --password invalid sftp://ci-deploy@ess.cs.uos.de + diff --git a/lib/loader/kconfig.py b/lib/loader/kconfig.py index 2c274cf..80bdd21 100644 --- a/lib/loader/kconfig.py +++ b/lib/loader/kconfig.py @@ -24,6 +24,9 @@ class KConfigAttributes: self.kconfig_root = "/".join(kconfig_path.split("/")[:-1]) kconfig_file = kconfig_path.split("/")[-1] + if self.kconfig_root == "": + self.kconfig_root = "." + with cd(self.kconfig_root): kconf = kconfiglib.Kconfig(kconfig_file) self.kconf = kconf |