v2ex / remote

Remote Worker
https://www.v2ex.com/go/dev
MIT License
81 stars 4 forks source link

Use Github Action to build image and test #19

Closed luxiaba closed 2 years ago

luxiaba commented 2 years ago
livid commented 2 years ago

Awesome, now I will adjust the script to launch the container on the production.

luxiaba commented 2 years ago

Exciting, but maybe the release on prod can wait until tomorrow? I'm want to test it at night to prevent online crashing like last time.

livid commented 2 years ago

Yes, I am currently testing it in staging. Since there is no significant feature change, it can wait.

We probably need an extra step after:

name: Build And Push

We need to test that just built image can at least answer /hello.

If it can run the whole test inside the container, better!

luxiaba commented 2 years ago

Yes, i'm trying to do this.

livid commented 2 years ago

During my initial testing, it seems config override is not working as expected.

livid commented 2 years ago
Screen Shot 2021-12-10 at 5 46 10 AM
livid commented 2 years ago

If it is working as we expected, /hello should return overridden UID instead of the one in base.py.

luxiaba commented 2 years ago

Yes, it's, let me check config load right now.

luxiaba commented 2 years ago

I think I know why it has not been updated.

I'm use flask config module to load our config, howerver flask will only load uppercase configurations, I think we should turn all configs to uppercase, it should be works fine.

livid commented 2 years ago

Understood.

UPPERCASE is also common as ENVIRONMENT VARIABLES.

So we can also override some config via env var, right?

luxiaba commented 2 years ago

Yes of course, but i'm not support it yet.

Do you need every config can be covered by environment variables with the same name?

livid commented 2 years ago

Yes, please. That would be great for Docker based deployments.

livid commented 2 years ago

I added some V2EX coins to your V2EX account. Now you have access to https://www.v2ex.com/i

It is also largely powered by this Remote Worker :)

Now with our recent improvements, it will support more formats with better performance and robustness.

luxiaba commented 2 years ago

Yes, please. That would be great for Docker based deployments.

Sure, my first thought is that base.py is a complete collection of all configs, so I will only support the overwriting of these configs from env, is that ok?

livid commented 2 years ago

Yes, base.py provides the default values and a standard list of things that we can read from env var.

If we need anything new in the future, we will extend base.py first.

livid commented 2 years ago

BTW this is a little macOS SwiftUI app @kailuo and I are working on for launching backend apps in the local development environment. 😄

Screen Shot 2021-12-10 at 6 42 59 AM
luxiaba commented 2 years ago

wow another MOD's product, seems very simple and beautiful! ☺️

livid commented 2 years ago

Thanks.

I tried to override REGION in staging but did not get the expected result.

Do I need any prefix or something?

Screen Shot 2021-12-10 at 7 06 32 AM
luxiaba commented 2 years ago

My bad, if not specified one env (prod / test / dev / ...), it will not load anything from file/env, i'll update this behavior to:

  1. Load from base.py first.
  2. Then if specified one env, try load config from corresponding file to override.
  3. At last, try load each config on base from env to override.
livid commented 2 years ago

Yeah, if we can selectively pass ENV in, then a .py override config is not required.

luxiaba commented 2 years ago

I added some V2EX coins to your V2EX account. Now you have access to https://www.v2ex.com/i

Thank you for your kindness. 🥳