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

Automatically remove Docker id BYOC once they are offline for > 1 day #712

Open
HariSekhon opened this issue Mar 18, 2020 · 10 comments
Open

Comments

@HariSekhon
Copy link

HariSekhon commented Mar 18, 2020

Hi,

Dockerized AppVeyor BYOC instances accumulate on the page after being deleted:

https://ci.appveyor.com/build-clouds

It might be worth automatically removing docker id named hosts from this page automatically if they are offline for say 1 day.

Screenshot 2020-03-18 at 4 07 55 PM

Thanks

Hari

@FeodorFitsner
Copy link
Member

Are those instances like disposable?

@HariSekhon
Copy link
Author

@FeodorFitsner yes they're docker containers, so once they're gone, they're gone.

@FeodorFitsner
Copy link
Member

Why would you need to constantly add/remove Docker clouds anyway? As it's not a common scenario you can just do a scheduled script deleting those clouds via AppVeyor API.

@HariSekhon
Copy link
Author

I think if using Docker this is actually a very standard pattern.

If you run BYOC in Kubernetes or Docker these are going to be replaced with new containers with different auto-generated names over time naturally so you will accumulate lots of dead byoc references.

@HariSekhon
Copy link
Author

I'm about to write a script for the AppVeyor API as a quick workaround as suggested, but cannot find much documentation for this:

https://www.appveyor.com/docs/api/

Is deleting old BYOC clouds documented anywhere?

I was gonna do a query, filter on offline and remove those so that it doesn't remove the currently active one...

@HariSekhon
Copy link
Author

Documentation seems a bit thin, found this unofficial API doc:

https://kevinoid.github.io/appveyor-swagger/bootprint/

but even on there I can't see an endpoint to query and delete BYOC clouds.

@FeodorFitsner
Copy link
Member

the best way to see an API call is in "Network" tab of your browser. UI uses the same API.

...still why would you need to run AppVeyor in a new container every time? You are supposed to install AppVeyor Host Agent to Docker host and host agent will be creating a new container for every build.

@HariSekhon
Copy link
Author

Oh I see, you expect it installed in base and then it calls docker, so the agent id is always that of the underlying host... I had used it inside Docker itself as a temporary agent as other CI systems.

Will have a look at dumping the UI from the web browser, but it would be good to have an officially documented API.

@HariSekhon
Copy link
Author

Just wrote a quick script to do this, it worked to clean up my account, thanks!

@FeodorFitsner
Copy link
Member

We will documented, sure. We are currently migrating to .NET Core so there will be some changes.

This is more info about running Docker builds with AppVeyor: https://www.appveyor.com/docs/server/#docker-1

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

No branches or pull requests

2 participants