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

ISSUE-1980: Changes for CloudScanner auto upgrade and cloud agent #2139

Merged
merged 3 commits into from
May 16, 2024

Conversation

varunsharma0286
Copy link
Collaborator

Fixes #
https://github.com/deepfence/enterprise-roadmap/issues/1980

Changes proposed in this pull request:

  • Adding support for cloud scanner auto upgrade.
  • Adding cloud scanner as an agent plugin
  • Adding support for deploying cloudscanner as an agent

@varunsharma0286 varunsharma0286 marked this pull request as ready for review May 9, 2024 17:36
Comment on lines +1 to +25
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0700

[supervisord]
logfile=%(ENV_DF_INSTALL_DIR)s/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid
childlogdir=%(ENV_DF_INSTALL_DIR)s/var/log/supervisor

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:deepfenced]
environment=DF_ENABLE_CLOUD_NODE=true
command=/bin/deepfenced
numprocs=1
autostart=true
autorestart=true
startsecs=0
stopwaitsecs=30
killasgroup=true
priority=50
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we resue the same as agent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We are using the DF_INSTALL_DIR env variable for the cloud scanner agent which we are not using in the case of regular agent. This env is required to setup the directory structure (/home/deepfence) for the cloudscanner agent.

}
}
log.Info().Msgf("Started processes:%s", strings.Join(startedProcesses, ","))
log.Info().Msgf("Failed processes:%s", strings.Join(failedProcess, ","))

if enableClusterDiscovery {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit switch instead?

deepfence_bootstrapper/main.go Outdated Show resolved Hide resolved
deepfence_bootstrapper/router/common.go Outdated Show resolved Hide resolved
@@ -87,6 +93,7 @@ func restartSelf() error {
}
argv0, err := exec.LookPath(os.Args[0])
if err != nil {
log.Error().Msgf(err.Error())
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Since we push the err to next layer, not needed

deepfence_bootstrapper/supervisor/process.go Show resolved Hide resolved
@varunsharma0286 varunsharma0286 force-pushed the ISSUE-1980-FINAL branch 2 times, most recently from fbc8585 to 79674ad Compare May 16, 2024 08:01
@varunsharma0286 varunsharma0286 merged commit 3ac0344 into main May 16, 2024
0 of 4 checks passed
@varunsharma0286 varunsharma0286 deleted the ISSUE-1980-FINAL branch May 16, 2024 10:45
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.

None yet

2 participants