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

docs: Add document for environment variables #5080

Merged
merged 6 commits into from
Feb 12, 2021
Merged

docs: Add document for environment variables #5080

merged 6 commits into from
Feb 12, 2021

Conversation

terrytangyuan
Copy link
Member

Currently we have the use of environment variables in many places at different levels but there's no documentation on them. This PR takes an initial stab at documenting them.

cc @alexec @simster7

Signed-off-by: terrytangyuan [email protected]

Checklist:

Copy link
Member

@simster7 simster7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be awesome if this could be auto-generated by looking at source files. This would also force the documentation to appear in someway in the location where it is used. Do you think you could manage a script to do that @terrytangyuan ?

@simster7
Copy link
Member

Similar to how all of our other docs are generated (fields.md from *_types.go, etc.)

@@ -0,0 +1,46 @@
# Environment Variables

This document outlines the set of environment variables that can be set to customize the behaviours at different levels.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be clearly stated that these are unsupported and may be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Just added a note on this.

@terrytangyuan
Copy link
Member Author

terrytangyuan commented Feb 11, 2021

It'd be awesome if this could be auto-generated by looking at source files. This would also force the documentation to appear in someway in the location where it is used. Do you think you could manage a script to do that @terrytangyuan ?

@simster7 Yes that's definitely achievable. However I think it's a bit overkill and it doesn't seem to require a lot of efforts maintaining this document at this point. I agree that in the long term it makes sense to automate the process as the list grows so it's easy to maintain but perhaps low priority for now.

| `REMOVE_LOCAL_ART_PATH` | bool | Whether to remove local artifacts. |


## CLI
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think can exclude CLI ones, you can run argo --help

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Removed this section.

@@ -0,0 +1,36 @@
# Environment Variables

This document outlines the set of environment variables that can be used to customize the behaviours at different levels.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm wrong about the text for this. I think we should not emphasize they are unsupported, more that they are typically added to test out experimental features and should not be needed by most users.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds much better actually. I just pasted the exact sentence you said but feel free to modify further.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually explicitly say that these may be removed at any time

@alexec
Copy link
Contributor

alexec commented Feb 11, 2021

@simster7 before merge, you always have valuable opinions on docs, do you want to take a look?

Copy link
Member

@simster7 simster7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still believe that this should be auto generated, or at the very least it should have an automatic check that all of the flags here still exist in the codebase and that no flags that exist in the code base are not here. Otherwise this file would in practice get neglected and become out of date soon.

This could be done with a simple regex:
image

@@ -0,0 +1,36 @@
# Environment Variables

This document outlines the set of environment variables that can be used to customize the behaviours at different levels.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually explicitly say that these may be removed at any time

|----------|------|------------|
| `ALL_POD_CHANGES_SIGNIFICANT` | bool | Whether to consider all pod changes as significant during pod reconciliation. |
| `ALWAYS_OFFLOAD_NODE_STATUS` | bool | Whether to always offload the node status. |
| `ARCHIVED_WORKFLOW_GC_PERIOD` | time.duration | The periodicity for GC of archived workflows. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor, but correct capitalization emphasizes that this is the Go type

Suggested change
| `ARCHIVED_WORKFLOW_GC_PERIOD` | time.duration | The periodicity for GC of archived workflows. |
| `ARCHIVED_WORKFLOW_GC_PERIOD` | time.Duration | The periodicity for GC of archived workflows. |


| Name | Type | Description|
|----------|------|------------|
| `ALL_POD_CHANGES_SIGNIFICANT` | bool | Whether to consider all pod changes as significant during pod reconciliation. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also wrap types in in-line codeblocks to be consistent with our docs elsewhere

Suggested change
| `ALL_POD_CHANGES_SIGNIFICANT` | bool | Whether to consider all pod changes as significant during pod reconciliation. |
| `ALL_POD_CHANGES_SIGNIFICANT` | `bool` | Whether to consider all pod changes as significant during pod reconciliation. |

@terrytangyuan
Copy link
Member Author

terrytangyuan commented Feb 11, 2021

@simster7 Thanks! Just addressed the comments.

I probably don't have width to work on automating this at this point yet. Anyone else please feel free to contribute that before I get to it. Just in case someone else might be working on this, note that besides env.LookupEnv** from our own utils (which we only have a few that uses those), there are also uses of os.LookupEnv, os.Getenv, etc. that should be taken into account when writing the automation code.

| `LEADER_ELECTION_IDENTITY` | `string` | The ID used for workflow controllers to elect a leader. |
| `MAX_OPERATION_TIME` | `time.Duration` | The maximum time a workflow operation is allowed to run for before requeuing the workflow onto the work queue. |
| `OFFLOAD_NODE_STATUS_TTL` | `time.Duration` | The TTL to delete the offloaded node status. Currently only used for testing. |
| `POD_GC_TRANSIENT_ERROR_MAX_REQUEUES` | `int` | The maximum number of requeues of pods in the GC queue when encountering transient errors. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, can you remove this and add it in #5060 so that it doesn't fail the check when I merge #5091?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and rebased.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add this in #5060 once this has been merged.

Signed-off-by: terrytangyuan <[email protected]>
Signed-off-by: terrytangyuan <[email protected]>
Signed-off-by: terrytangyuan <[email protected]>
Signed-off-by: terrytangyuan <[email protected]>
Signed-off-by: terrytangyuan <[email protected]>
@simster7 simster7 merged commit cda5dc2 into argoproj:master Feb 12, 2021
@terrytangyuan terrytangyuan deleted the env-vars-doc branch February 12, 2021 15:12
@simster7 simster7 mentioned this pull request Feb 16, 2021
33 tasks
@simster7 simster7 mentioned this pull request Feb 23, 2021
34 tasks
@simster7 simster7 mentioned this pull request Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants