Zero downtime deployments (blue/green) on Traefik, how? - continuous-deployment

On a single Traefik instance, is it possible to do service deployments without a service becoming unreachable during the process?
It does not seem like there is any write-api that can dynamically switch traffic/routing nor is there a concept of "de-registering" containers.
Even when using load-balancer, since there is no concept of "gracefully" killing a container, any open connection will be killed.

Related

aws ec2 and gcp e2 instances constantly become unresponsive

I've deployed a Django app on AWS-ec2-micro instance and a React app on GCP-e2-micro instance before, but I encountered almost the exact same problem: Server will randomly become unresponsive and unreachable while doing some heavy I/O operations. It happens almost all the time if I try to install some large packages such as tesseract, but it sometimes freezes even when I'm just trying to run a react app using npm start. I've looked at the monitoring and they all have one thing in common: super high CPU usage. Especially after the server becomes unreachable, the CPU meters continue to rise. AWS-ec2 usually will reach almost 100% while GCP-e2 instance will reach beyond 100% to something like 140%. At a certain time, the CPU usage will become stabilized at about 50%, but the server is still unreachable using SSH.
The server sometimes recovers itself after hours of being unreachable, but usually, it ends up having to force stop and restart the server. This will cause the public ipv4 to change which I really don't like, so I want to find out why my server is constantly unresponsive.
Here is what I've installed on my server:
ssh-server
vscode-server
And then on GCP-e2, I've also installed npm, react and some UI packages. A simple react app should not have such a high I/O operation that will directly makes the server unresponsive, so I begin to think if I have something configured wrong, but I have no clue what that will be. Please help me. Thank you!
I had the same issue, I used the free tier t2.micro and it was not keeping up with all the processes that needed to be handled when executing npx create-react-app react-webapp. I had to reboot it at least 2 times to be able to ssh into it again.
Upgrading the instance type to c5a.large solved the problem, hope this helps.

Can (should) Docker be used for winforms applications?

I have heard that docker solves the "works on my machine" issue for application deployment and that SQL Server can be run inside a docker container, running in Docker for Windows.
I have a C# Windforms application that I would like to deploy without Dll Hell.
Is it possible to use Docker for this?
sort of, but i wouldn't.
docker isn't meant for interactive / gui based applications at this point. there are some workarounds for this, but all of them are difficult from what I've read.
it's better to think of Docker as a server. you don't have a person sitting at a server all day long, clicking things to respond to requests that come into the server. you have code that runs, listening for requests and doing things in response.
Docker apps should be this type of app where it runs on it's own, exposes an API and can respond to requests.
... i would bet that this becomes possible in the not-so-distant future. but right now, i don't think it's something Docker officially supports.

Any way to run multiple Google App Engine local instances for appengineFunctionalTest?

Background
From the docs, at https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
I see that by putting my functionalTests in /src/functionalTests/java does the following:
Starts the Local GAE instance
runs tests in the functionalTests directory
Stops the Local instance after the tests are complete
My Issue
For my microservices, I need to have 2 local servers for running my tests. 1 server is responsible for a lot of auth operations, and the other microservices talk to this server for some verification operations.
I've tried
appengineFunctionalTest.dependsOn ':authservice:appengineRun'
this does start the dependent server, but then it hangs and the tests don't continue. I see that I can set deamon = true and start the server on a background thread, but I can only seem to do that in isolation.
Is there a way to have a 'dependsOn' also be able to pass parameters to the dependent task? I haven't found a way to make that happen.
Or perhaps there is another way to accomplish this.
Any help appreciated

Safe deployment of GAE apps

I want to make sure that when I update my GAE site that it does not have any bad side effects for users who are currently using my site.
Does Google automatically make this a safe process, e.g. by:
complete all pending requests
temporarily delay new requests
update code
process new requests
Or does Google just terminate whatever is running and update the server code?
If the latter, any recommendations for doing a safe update? Any other precautions for tasks in queues?
I think that for some (usually quite short) time, your two versions are serving side-by-side. So some requests are on the new version, but some are still finishing up on the old version. Be sure to consider that when thinking about how your data structures will update.
Occasionally, I have received errors from a small number of users while deploying.
I think the safest way to do it is to deploy to a new 'version' that isn't the active one, then to change your default 'version' in the admin console. This ensures the quickest, cleanest, changeover.

Why can't I use a UI component (Windows form) inside of a Windows service?

I've seen several posts that essentially state that UI components shouldn't run as a service. I understand the rational that no one can respond to UI events etc. But the fact remains that are are many automation tasks that are only possible with Windows forms.
Here is a couple of great examples:
I would like to build a url crawler
service that makes thumbnails of
webpages. Currently the only way I
see to achieve this is to try and
automate the .Net WebBroswer
component.
Automate the printing of MS-Word
docs.
Pre-Vista there was some tricks to get around this, but now there is none. My question is why is this the case, and what alternatives does one really have?
Lookup Shatter Attacks and Session 0 Isolation Feature.
Basically if two processes (of different users) share the same desktop, one process can potentially execute whatever code it wants in the other process by sending windows messages, and this was called a Shatter Attack.
There was a lot of discussion whether this was a design bug or not, and post Vista, Microsoft decided to remove any interactive desktop support for services as that was a potential security hole.
As an alternative, you can consider, running your image generation/printing code as a logged in user, who has access to an interactive desktop.
Like Moron said best thing to do is not run it as a service.
But perhaps you're stuck running it from a service anyway, because there is an existing framework of some sort that you're needing to run your code from.
So the workaround to that would be to write a server program that runs as a logged in user. You will hit that server program from your code the must be in a service. The server will do the work and return the results.
You can communicate between the 2 using WCF over named pipes as the transport, or whatever works. If that doesn't, you can use bare named pipes, or, tcp/ip on the localhost. Judging from your website in your userprofile, you should know all about localhost!
Technically, UI components requires started Windows Message Queue to work. You can run it from windows service (may be with allowed Interaction with Desktop, as far as I know this feature is disabled in Windows Vista and higher).
But things you are talking about is not UI components, it is COM components, and you can use it. At least MS Office, but it is not recommended by Microsoft, because memory leaks are possible. Latest MS Office has server edition, that can be used in application without user interface.

Resources