ci: adjust expire time for CI artifacts:

set shorter time to save some space on server. For those artifacts need
to be stored for long time, we can manually press "keep" button in job page.

Also add a CI job to check if all artifacts have set expire time.
This commit is contained in:
He Yin Ling 2018-09-20 16:11:54 +08:00 committed by bot
parent 0a7065195c
commit b4fe43912f
2 changed files with 78 additions and 34 deletions

View file

@ -142,7 +142,7 @@ build_template_app:
artifacts: artifacts:
paths: paths:
- SSC/ssc_bin - SSC/ssc_bin
expire_in: 1 mos expire_in: 1 week
variables: variables:
SSC_CONFIG_FOLDER: "$CI_PROJECT_DIR/SSC/configs/ESP32_IDF" SSC_CONFIG_FOLDER: "$CI_PROJECT_DIR/SSC/configs/ESP32_IDF"
script: script:
@ -170,7 +170,7 @@ build_esp_idf_tests:
- tools/unit-test-app/output - tools/unit-test-app/output
- components/idf_test/unit_test/TestCaseAll.yml - components/idf_test/unit_test/TestCaseAll.yml
- components/idf_test/unit_test/CIConfigs/*.yml - components/idf_test/unit_test/CIConfigs/*.yml
expire_in: 1 mos expire_in: 2 days
script: script:
- cd tools/unit-test-app - cd tools/unit-test-app
- MAKEFLAGS= make help # make sure kconfig tools are built in single process - MAKEFLAGS= make help # make sure kconfig tools are built in single process
@ -192,7 +192,7 @@ build_esp_idf_tests:
- build_examples/*/*/*/build/download.config - build_examples/*/*/*/build/download.config
- build_examples/*/*/*/build/bootloader/*.bin - build_examples/*/*/*/build/bootloader/*.bin
- $LOG_PATH - $LOG_PATH
expire_in: 1 week expire_in: 2 days
variables: variables:
IDF_CI_BUILD: "1" IDF_CI_BUILD: "1"
LOG_PATH: "$CI_PROJECT_DIR/log_examples_make" LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
@ -219,7 +219,7 @@ build_esp_idf_tests:
- build_examples_cmake/*/*/*/build/download.config - build_examples_cmake/*/*/*/build/download.config
- build_examples_cmake/*/*/*/build/bootloader/*.bin - build_examples_cmake/*/*/*/build/bootloader/*.bin
- $LOG_PATH - $LOG_PATH
expire_in: 1 week expire_in: 2 days
variables: variables:
IDF_CI_BUILD: "1" IDF_CI_BUILD: "1"
LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake" LOG_PATH: "$CI_PROJECT_DIR/log_examples_cmake"
@ -301,7 +301,7 @@ build_docs:
- docs/zh_CN/sphinx-warning-log.txt - docs/zh_CN/sphinx-warning-log.txt
- docs/zh_CN/sphinx-warning-log-sanitized.txt - docs/zh_CN/sphinx-warning-log-sanitized.txt
- docs/zh_CN/_build/html - docs/zh_CN/_build/html
expire_in: 1 mos expire_in: 1 day
script: script:
- cd docs - cd docs
- ./check_lang_folder_sync.sh - ./check_lang_folder_sync.sh
@ -338,6 +338,7 @@ test_nvs_coverage:
artifacts: artifacts:
paths: paths:
- components/nvs_flash/test_nvs_host/coverage_report - components/nvs_flash/test_nvs_host/coverage_report
expire_in: 1 week
only: only:
- triggers - triggers
# This job takes a few hours to finish, so only run it on demand # This job takes a few hours to finish, so only run it on demand
@ -360,6 +361,7 @@ test_wl_on_host:
artifacts: artifacts:
paths: paths:
- components/wear_levelling/test_wl_host/coverage_report.zip - components/wear_levelling/test_wl_host/coverage_report.zip
expire_in: 1 week
script: script:
- cd components/wear_levelling/test_wl_host - cd components/wear_levelling/test_wl_host
- make test - make test
@ -381,7 +383,7 @@ test_fatfs_on_host:
paths: paths:
- ${FUZZER_TEST_DIR}/out/crashes - ${FUZZER_TEST_DIR}/out/crashes
- ${FUZZER_TEST_DIR}/fuzz_output.log - ${FUZZER_TEST_DIR}/fuzz_output.log
expire_in: 1 mos expire_in: 1 week
only: only:
# can only be triggered # can only be triggered
- triggers - triggers
@ -575,7 +577,7 @@ check_doc_links:
artifacts: artifacts:
paths: paths:
- docs/_build/linkcheck - docs/_build/linkcheck
expire_in: 1 mos expire_in: 1 week
script: script:
# must be triggered with CHECK_LINKS=Yes, otherwise exit without test # must be triggered with CHECK_LINKS=Yes, otherwise exit without test
- test "$CHECK_LINKS" = "Yes" || exit 0 - test "$CHECK_LINKS" = "Yes" || exit 0
@ -584,23 +586,21 @@ check_doc_links:
- cd docs - cd docs
- make linkcheck - make linkcheck
check_line_endings: .check_job_template: &check_job_template
stage: check stage: check
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags: tags:
- build - build
dependencies: [] dependencies: []
before_script: *do_nothing_before_no_filter before_script: *do_nothing_before_no_filter
check_line_endings:
<<: *check_job_template
script: script:
- tools/ci/check-line-endings.sh ${IDF_PATH} - tools/ci/check-line-endings.sh ${IDF_PATH}
check_commit_msg: check_commit_msg:
stage: check <<: *check_job_template
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags:
- build
dependencies: []
before_script: *do_nothing_before_no_filter
script: script:
- git status - git status
- git log -n10 --oneline - git log -n10 --oneline
@ -608,42 +608,34 @@ check_commit_msg:
- 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0' - 'git log --pretty=%s master.. -- | grep "^WIP: " && exit 1 || exit 0'
check_permissions: check_permissions:
stage: check <<: *check_job_template
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags:
- build
dependencies: []
before_script: *do_nothing_before_no_filter
script: script:
- tools/ci/check-executable.sh - tools/ci/check-executable.sh
check_examples_cmake_make: check_examples_cmake_make:
stage: check <<: *check_job_template
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags:
- build
except: except:
- master - master
- /^release\/v/ - /^release\/v/
- /^v\d+\.\d+(\.\d+)?($|-)/ - /^v\d+\.\d+(\.\d+)?($|-)/
dependencies: []
before_script: *do_nothing_before before_script: *do_nothing_before
script: script:
- tools/ci/check_examples_cmake_make.sh - tools/ci/check_examples_cmake_make.sh
check_submodule_sync: check_submodule_sync:
stage: check <<: *check_job_template
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
tags:
- build
dependencies: []
variables: variables:
GIT_STRATEGY: clone GIT_STRATEGY: clone
before_script: *do_nothing_before_no_filter
script: script:
# check if all submodules are correctly synced to public repostory # check if all submodules are correctly synced to public repostory
- git submodule update --init --recursive - git submodule update --init --recursive
check_artifacts_expire_time:
<<: *check_job_template
script:
# check if we have set expire time for all artifacts
- python tools/ci/check_artifacts_expire_time.py
assign_test: assign_test:
tags: tags:
- assign_test - assign_test
@ -664,7 +656,7 @@ assign_test:
- components/idf_test/*/CIConfigs - components/idf_test/*/CIConfigs
- components/idf_test/*/TC.sqlite - components/idf_test/*/TC.sqlite
- $EXAMPLE_CONFIG_OUTPUT_PATH - $EXAMPLE_CONFIG_OUTPUT_PATH
expire_in: 1 mos expire_in: 1 week
before_script: *add_gitlab_key_before before_script: *add_gitlab_key_before
script: script:
# assign example tests # assign example tests
@ -709,7 +701,7 @@ assign_test:
when: always when: always
paths: paths:
- $LOG_PATH - $LOG_PATH
expire_in: 1 mos expire_in: 1 week
variables: variables:
TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw" TEST_FW_PATH: "$CI_PROJECT_DIR/tools/tiny-test-fw"
TEST_CASE_PATH: "$CI_PROJECT_DIR/examples" TEST_CASE_PATH: "$CI_PROJECT_DIR/examples"
@ -758,7 +750,7 @@ assign_test:
when: always when: always
paths: paths:
- $LOG_PATH - $LOG_PATH
expire_in: 1 mos expire_in: 1 week
variables: variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF" LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32_IDF"
LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA" LOG_PATH: "$CI_PROJECT_DIR/$CI_COMMIT_SHA"

View file

@ -0,0 +1,52 @@
#!/usr/bin/env python
# internal use only
# check if expire time is set for all artifacts
import os
import yaml
IDF_PATH = os.getenv("IDF_PATH")
if not IDF_PATH:
print("Please set IDF_PATH before running this script")
raise SystemExit(-1)
GITLAB_CONFIG_FILE = os.path.join(os.getenv("IDF_PATH"), ".gitlab-ci.yml")
def check_artifacts_expire_time():
with open(GITLAB_CONFIG_FILE, "r") as f:
config = yaml.load(f)
errors = []
print("expire time for jobs:")
job_names = config.keys()
job_names.sort()
for job_name in job_names:
if job_name.startswith("."):
# skip ignored jobs
continue
try:
if "expire_in" not in config[job_name]["artifacts"]:
errors.append(job_name)
else:
print("{}: {}".format(job_name, config[job_name]["artifacts"]["expire_in"]))
except (KeyError, TypeError):
# this is not job, or the job does not have artifacts
pass
if errors:
print("\n\nThe following jobs did not set expire time for its artifacts")
for error in errors:
print(error)
raise SystemExit(-2)
if __name__ == '__main__':
check_artifacts_expire_time()