-
Notifications
You must be signed in to change notification settings - Fork 3
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
[RFC] Revamp of How Container Configuration Is Updated #81
Comments
Great write up
I assume we will still do var subs so this should be word smithed a little. For example I wouldn't want the OS password sitting in plain text on my control computer. A P2 would be if I want to stick my OIDC password in AWS Service X it would be nice to do some kind of var sub on it. Example: client_secret={CLIENT_SECRET_VAR} and should be an easy way to get that.
Would like to discuss this, too much to type, not sure totally on board yet.
Not totally sure the purpose of the manifest.json if you just copy everything in files directory. Other: |
Thanks for the comments!
Yeah, I see your point. What I mean is that we will deliver the
Let's discuss; happy to change course if there's a better option
We're not making assumptions that the files the user wants in the container are located in any specific location client side. Additionally, we want the user to specify any location for the file to be delivered in-container. However, the bigger issue is: how do you keep track of which file, where, on the client-side ends up where on the container-side? This was my simplified solution.
I was thinking the repo should be runnable "as-is", meaning the configuration files for the default behavior are already in the "correct" location to just "go". I haven't spent too many cycles on how folks version control their changes, but yeah - probably something to think through and open to your thoughts on the topic. I think the |
I think the sequence of operations we perform on container start could be filled in/clarified a bit more. Here's what I'm thinking:
|
Regarding where user will stick their own configuration, I think the
We keep track of the Anyways, this enables us to do something like as described before and stick all our "default" files in the repo so it will just "go" when the user runs
By default, |
Had a great convo w/ @awick about the proposal. Some takeaways:
|
Thought about things a bit more and think it makes sense to ditch the
|
LGTM |
Plan looks something like this:
|
Proposal
We will provide a no-code mechanism for light/medium modification of the Capture/Viewer container contents and behavior. We will try not to block users that need heavy modification of the containers.
update-config
We will create a new CLI command (name TBD) that updates the running container configuration without requiring a rebuild of the underlying Docker images or a CloudFormation Update. The command will take user-specified configuration and deploy it to the Capture/Viewer containers in a gradual or otherwise "safe" manner. We will provide a way to roll back bad configuration, though this may be manual initially.
create-cluster
We will update the
create-cluster
CLI command to use the same distribution method as the new CLI command to set up initial container configuration. By default, if there is an existing configuration, re-runningcreate-cluster
will not update it. The user can specify a flag to overwrite pre-existing configuration; we have a special flag for this because this creates situations where it may be impossible to successfully roll-back automatically.Arkime config.ini
We will expose the capture and viewer .INI files to the user in plain-text. The user is free to modify them as desired (including changing Auth and other settings). We will deliver them without additional modification to the containers as part of
create-cluster
andupdate-config
. We will perform client-side vetting to ensure the files meet the Arkime spec and alert the user pre-deployment if the files are obviously malformed.Startup Behavior
We will update the startup behavior of the containers to be as generic as possible. We will move configuration-specific behavior to a separate script which will be delivered as part of container startup rather than baked into the images.
Startup Customization
We will expose one bash script, each, for the capture and viewer containers which contains any special startup commands required to configure the container at launch beyond startup of the Arkime processes and other generic actions. These scripts will contain most of the behavior currently in the
run_capture_node.sh
andrun_viewer_node.sh
scripts, such as thesed
commands to update entries in the Arkimeconfig.ini
files. The user will be free to modify the behavior in these scripts. We will deliver the scripts to the container and execute them during startup.Additional Files
We will expose one manifest file, each, for the capture and viewer containers which contains mappings between the absolute/relative path on-disk to a client-side file and an absolute path of where it should live in-container. We will package the files specified in the manifest and deliver them to the containers as a part of
create-cluster
andupdate-config
. An example of a file to be delivered in this way is thedefault.rules
file we're currently embedding in the Capture container's image. The user is free to add any additional files they want delivered to the Capture and Viewer containers to their respective manifests.Suggested Implementation
Location of configuration files in-Repo
Updates to
create-cluster
update-config
for this step.source
thestartup.sh
.Updates to
list-clusters
Behavior of
update-config
UpdateService
API's force-deploy option to bounce the containers in the Capture and/or Viewer fleets according to a deployment plan.How Config Rollbacks Will Work
Assumptions:
Approach:
create-cluster
, the containers fail to stabilize, then this will eventually result in the CloudFormation failure and rollback. This rollback is guaranteed to succeed because (be default)create-cluster
only uploads the latest config if no configuration currently exists. This means that we know the previous config version worked with the previous CloudFormation template. If there is no previous config, it's the first deployment of the stack(s) and a deployment failure/rollback doesn't matter because the cluster is not in use.update-config
, the containers fail to stabilize, we will notice by monitoring the deployment for failedTasks using the deployment ID and the DescribeServices API. If we see multiple failedTasks, we will update the Parameter Store to use the "previous" config version. This should result in the next attempt to start up the containers to succeed, as we know it succeeded previously (otherwise it wouldn't be recorded in Parameter Store).FAQs
Why not use AWS CodePipeline to manage deployments?
CodePipeline appears be a viable alternative for managing the update of both the underlying Docker Image and the deployed files/configuration. The advantage of CodePipeline is that it provides pre-made mechanisms for deployment safety (especially automated rollbacks). The disadvantage of CodePipeline is that it would require a substantial rework of the the existing repo in order to leverage properly and it would add quite a few additional components to our solution. If we run into problems with the suggested approach above, we should consider this a plausible backup plan.
Why not use AWS AppConfig?
AWS AppConfig isn't designed to perform this type of configuration. Its sweet spot is to provide a way to distribute things like feature flags, allow lists, permission, etc that the on-host processes can then pull to modify their behavior. It is not designed to distribute files and perform on-disk actions like running scripts.
Why not use a pre-built configuration management tool (SaltStack, Ansible, Chef, etc)?
For the project's current scope it requires a substantial upfront investment in infrastructure setup and a steep learning curve for users that seems disproportionate to the relative additional benefit.
How can I invoke additional executables during startup?
You can either stick the commands you want to execute in the
startup.sh
script we execute on container start or stick additional executables in the files transfered to the container and invoke them from thestartup.sh
.Related Tasks
The text was updated successfully, but these errors were encountered: