Closed eu9ene closed 2 months ago
@bhearsum what would be the best/proper way to detect that we're in CI from inside Python code? Do we have any extra environment variables set? Or do we have to just add an extra config setting for this and propagate a new env var?
That CI task has the following env vars:
FIREFOX_TRANSLATIONS_TRAINING_HEAD_REF: bump_disk_cefilter
FIREFOX_TRANSLATIONS_TRAINING_HEAD_REV: 3151f7696dc000379b921f08f6d0dad18fc4003a
FIREFOX_TRANSLATIONS_TRAINING_BASE_REPOSITORY: https://github.com/mozilla/firefox-translations-training
FIREFOX_TRANSLATIONS_TRAINING_HEAD_REPOSITORY: https://github.com/mozilla/firefox-translations-training
FIREFOX_TRANSLATIONS_TRAINING_REPOSITORY_TYPE: git
@eu9ene If you link a production training run, we can compare the env variables, and those would be either missing or different enough that we can infer we are on CI (especially the head ref)
We can do a simpler thing. Let's just check the experiment name:
if experiment["name"] == "ci":
project = "ci"
else:
project = f"{experiment['src']}-{experiment['trg']}"
Here's the CI experiment config:
Since experiment tracking is now tightly integrated with training and evaluation scripts we should make sure refactorings don't break compatibility with the tracking module.
Let's enable publishing in CI. To not pollute the current default project in CI config (ru-en), let's somehow detect that it's CI from the tracking module and publish it to a separate project (named
ci
).