guldan是一个配置管理中心,通过guldan用户可用方便的实现自己应用的配置管理。
架构如下图所示
用户
配置
用户的权限
配置的可见性
现提供一下两种客户端使用方式
具体的使用方式,可以参见python client
具体的使用方式,可以参见go client
具体的使用方式,可以参见java client
具体的使用方式,可以参见guldan proxy
正常的配置发布,用户或者客户端直接拉取就可以了。
每一次的配置修改发布都使得配置项的版本号增加,以标识不同的配置项版本。
当用户选择灰度发布配置项时,并不会影响主干上的配置项。 用户可以对灰度的配置项做修改和发布操作,但是灰度发布的配置项不支持版本管理。
当用户想要获取配置项的灰度版本时,需要在拉取时,带上grey=true的选项,这样拉取的就是灰度发布的版本了。 如果用户使用我们提供的客户端,该选项会自动带上。
由于这两个环境并没有打通,也就是说这两套系统是完全独立的,所以你在测试环境上做过的测试,在上线之前请务必确认在生产环境上也做了配置。
为了方便通过程序的方式来管理guldan,我们提供了web api
bash
cd guldan_root
virtualenv guldanenv
source guldanenv/bin/activate
pip install -r requirements.txt
以下为guldan的依赖
请在部署前,确认申请并设置好以上资源,并做以下的初始化
确认好以上信息之后,就可以在config.py中将配置填入AppConfig中。
在确认了以上配置后,将它们放入到环境变量中,
bash
export db_master=xxx
export db_slave=xxx
....
之后再运行
bash
cd guldan_root
/path/to/your/venv/bin/python guldan_start.py
guldan async是为了接收guldan web发的异步消息来设计的,主要是kafka的消费者
需要的配置如下
拿到上面的配置之后,还请把这些配置放入到环境变量中
bash
export redis_url=xxx
export metrics_url=xxx
....
然后执行下面的命令
bash
cd guldan_root
/path/to/your/venv/bin/python async_consumer/async_consumer.py
可以参考下面的链接进行docker的安装
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
对于ubuntu,可以采用下面的方式安装docker-compose
bash
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
1. 确认自己拥有docker命令的执行权限,如果没有,还请联系你的系统管理员,让他把你的用户名加入的docker用户组下。
guldan docker的base镜像,主要是用来安装guldan的依赖的其它的软件包。 因为在开发过程中,guldan的依赖的软件包不会有太大的变化,而且安装依赖软件包也是一个耗时的过程。
base镜像生成使用下面的命令
bash
cd guldan_root
docker build -f dockers/Dockerfile -t guldan_base:latest dockers
web镜像主要是启动guldan web服务的,使用如下命令生成guldan web镜像,你可以根据自己公司的policy更改生成镜像的tag。
bash
cd guldan_root
docker build -t guldan_web:latest .
guldan web的上线,同样需要设置容器的环境变量,配置项同guldan web部署
中提到的配置
bash
docker run -d -e db_master=xxx -e db_slave=xxx -e other configs guldan_web:latest
跟guldan web docker一样,guldan async docker也是依赖guldan base镜像的
bash
cd guldan_root
docker build -t guldan_async:latest async_consumer
启动时的环境变量,也请参考上面的guldan async 部署
bash
docker run -d -e redis_url=xxx -e .... guldan_async:latest
guldan的整个开发环境也是基于docker的,如果你还没有docker,还请参见上面的docker 环境准备
.
在项目中提供了guldan_setup.py
供开发者使用,具体的说明可以见guldan_setup.py -h
该命令会以docker的形式启动guldan依赖,以及guldan_web和guldan_async。成功setup之后,他启动了以下6个容器
跟guldan_setup.py
配合使用的是guldan_options.yml
文件,该文件中定义了guldan所需要的一些参数,开发者可以根据自己的需要进行修改。
用户需要将其中的127.0.0.1
替换成自己的开发机器地址,
bash
python guldan_setup.py run --guldan-port=8080 --guldan-option-file="./guldan_options.yml"
bash
python guldan_setup.py down
该命令会将启动的docker镜像停止并删除
如果guldan web的代码有改动,可以使用reload guldan
;
由于在开发环境,guldan是以默认的bridge模式启动的,所以下面的启动参数guldan-port
是主机上guldan映射的端口。
bash
python guldan_setup.py reload guldan --guldan-port=8080 --guldan-option-file="./guldan_options.yml"
如果guldan async的代码有改动,可以使用reload guldan_async
bash
python guldan_setup.py reload guldan_async --guldan-option-file="./guldan_options.yml"
如果你觉得在容器中,对guldan的调试不太方便,还可以使用一下默认启动guldan
python guldan.py
的方式进行启动werkzeug.serving
包的run_simple
方法,所以该方式不适合在生产上启动服务,仅用作调试使用config.py
中所定义的一些默认配置项,你需要将guldan的依赖的一些配置放入到这个文件中config.py
中填好uwsgi guldan_uwsgi_deploy.ini
Bumps certifi from 2017.11.5 to 2022.12.7.
9e9e840
2022.12.07b81bdb2
2022.09.24939a28f
2022.09.14aca828a
2022.06.15.2de0eae1
Only use importlib.resources's new files() / Traversable API on Python ≥3.11 ...b8eb5e9
2022.06.15.147fb7ab
Fix deprecation warning on Python 3.11 (#199)b0b48e0
fixes #198 -- update link in license9d514b4
2022.06.154151e88
Add py.typed to MANIFEST.in to package in sdist (#196)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Bumps ipython from 5.3.0 to 7.16.3.
d43c7c7
release 7.16.35fa1e40
Merge pull request from GHSA-pq7m-3gw7-gq5x8df8971
back to dev9f477b7
release 7.16.2138f266
bring back release helper from master branch5aa3634
Merge pull request #13341 from meeseeksmachine/auto-backport-of-pr-13335-on-7...bcae8e0
Backport PR #13335: What's new 7.16.28fcdcd3
Pin Jedi to <0.17.2.2486838
release 7.16.120bdc6f
fix conda buildDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Bumps urllib3 from 1.22 to 1.26.5.
Sourced from urllib3's releases.
1.26.5
:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap
- Fixed deprecation warnings emitted in Python 3.10.
- Updated vendored
six
library to 1.16.0.- Improved performance of URL parser when splitting the authority component.
If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors
1.26.4
:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap
- Changed behavior of the default
SSLContext
when connecting to HTTPS proxy during HTTPS requests. The defaultSSLContext
now setscheck_hostname=True
.If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors
1.26.3
:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap
Fixed bytes and string comparison issue with headers (Pull #2141)
Changed
ProxySchemeUnknown
error message to be more actionable if the user supplies a proxy URL without a scheme (Pull #2107)If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors
1.26.2
:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap
- Fixed an issue where
wrap_socket
andCERT_REQUIRED
wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)1.26.1
:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap
- Fixed an issue where two
User-Agent
headers would be sent if aUser-Agent
header key is passed asbytes
(Pull #2047)1.26.0
:warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap
Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)
Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning should opt-in explicitly by setting
ssl_version=ssl.PROTOCOL_TLSv1_1
(Pull #2002) Starting in urllib3 v2.0: Connections that receive aDeprecationWarning
will failDeprecated
Retry
optionsRetry.DEFAULT_METHOD_WHITELIST
,Retry.DEFAULT_REDIRECT_HEADERS_BLACKLIST
andRetry(method_whitelist=...)
in favor ofRetry.DEFAULT_ALLOWED_METHODS
,Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT
, andRetry(allowed_methods=...)
(Pull #2000) Starting in urllib3 v2.0: Deprecated options will be removed
... (truncated)
Sourced from urllib3's changelog.
1.26.5 (2021-05-26)
- Fixed deprecation warnings emitted in Python 3.10.
- Updated vendored
six
library to 1.16.0.- Improved performance of URL parser when splitting the authority component.
1.26.4 (2021-03-15)
- Changed behavior of the default
SSLContext
when connecting to HTTPS proxy during HTTPS requests. The defaultSSLContext
now setscheck_hostname=True
.1.26.3 (2021-01-26)
Fixed bytes and string comparison issue with headers (Pull #2141)
Changed
ProxySchemeUnknown
error message to be more actionable if the user supplies a proxy URL without a scheme. (Pull #2107)1.26.2 (2020-11-12)
- Fixed an issue where
wrap_socket
andCERT_REQUIRED
wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)1.26.1 (2020-11-11)
- Fixed an issue where two
User-Agent
headers would be sent if aUser-Agent
header key is passed asbytes
(Pull #2047)1.26.0 (2020-11-10)
NOTE: urllib3 v2.0 will drop support for Python 2.
Read more in the v2.0 Roadmap <https://urllib3.readthedocs.io/en/latest/v2-roadmap.html>
_.Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)
Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning
... (truncated)
d161647
Release 1.26.52d4a3fe
Improve performance of sub-authority splitting in URL2698537
Update vendored six to 1.16.007bed79
Fix deprecation warnings for Python 3.10 ssl moduled725a9b
Add Python 3.10 to GitHub Actions339ad34
Use pytest==6.2.4 on Python 3.10+f271c9c
Apply latest Black formatting1884878
[1.26] Properly proxy EOF on the SSLTransport test suitea891304
Release 1.26.48d65ea1
Merge pull request from GHSA-5phf-pp7p-vc2rDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Bumps pygments from 2.2.0 to 2.7.4.
Sourced from pygments's releases.
2.7.4
Updated lexers:
Fix infinite loop in SML lexer (#1625)
Fix backtracking string regexes in JavaScript/TypeScript, Modula2 and many other lexers (#1637)
Limit recursion with nesting Ruby heredocs (#1638)
Fix a few inefficient regexes for guessing lexers
Fix the raw token lexer handling of Unicode (#1616)
Revert a private API change in the HTML formatter (#1655) -- please note that private APIs remain subject to change!
Fix several exponential/cubic-complexity regexes found by Ben Caller/Doyensec (#1675)
Fix incorrect MATLAB example (#1582)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
2.7.3
... (truncated)
Sourced from pygments's changelog.
Version 2.7.4
(released January 12, 2021)
Updated lexers:
Fix infinite loop in SML lexer (#1625)
Fix backtracking string regexes in JavaScript/TypeScript, Modula2 and many other lexers (#1637)
Limit recursion with nesting Ruby heredocs (#1638)
Fix a few inefficient regexes for guessing lexers
Fix the raw token lexer handling of Unicode (#1616)
Revert a private API change in the HTML formatter (#1655) -- please note that private APIs remain subject to change!
Fix several exponential/cubic-complexity regexes found by Ben Caller/Doyensec (#1675)
Fix incorrect MATLAB example (#1582)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
Version 2.7.3
(released December 6, 2020)
... (truncated)
4d555d0
Bump version to 2.7.4.fc3b05d
Update CHANGES.ad21935
Revert "Added dracula theme style (#1636)"e411506
Prepare for 2.7.4 release.275e34d
doc: remove Perl 6 ref2e7e8c4
Fix several exponential/cubic complexity regexes found by Ben Caller/Doyenseceb39c43
xquery: fix pop from empty stack2738778
fix coding style in test_analyzer_lexer02e0f09
Added 'ERROR STOP' to fortran.py keywords. (#1665)c83fe48
support added for css variables (#1633)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Bumps pygments from 2.2.0 to 2.7.4.
Sourced from pygments's releases.
2.7.4
Updated lexers:
Fix infinite loop in SML lexer (#1625)
Fix backtracking string regexes in JavaScript/TypeScript, Modula2 and many other lexers (#1637)
Limit recursion with nesting Ruby heredocs (#1638)
Fix a few inefficient regexes for guessing lexers
Fix the raw token lexer handling of Unicode (#1616)
Revert a private API change in the HTML formatter (#1655) -- please note that private APIs remain subject to change!
Fix several exponential/cubic-complexity regexes found by Ben Caller/Doyensec (#1675)
Fix incorrect MATLAB example (#1582)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
2.7.3
... (truncated)
Sourced from pygments's changelog.
Version 2.7.4
(released January 12, 2021)
Updated lexers:
Fix infinite loop in SML lexer (#1625)
Fix backtracking string regexes in JavaScript/TypeScript, Modula2 and many other lexers (#1637)
Limit recursion with nesting Ruby heredocs (#1638)
Fix a few inefficient regexes for guessing lexers
Fix the raw token lexer handling of Unicode (#1616)
Revert a private API change in the HTML formatter (#1655) -- please note that private APIs remain subject to change!
Fix several exponential/cubic-complexity regexes found by Ben Caller/Doyensec (#1675)
Fix incorrect MATLAB example (#1582)
Thanks to Google's OSS-Fuzz project for finding many of these bugs.
Version 2.7.3
(released December 6, 2020)
... (truncated)
4d555d0
Bump version to 2.7.4.fc3b05d
Update CHANGES.ad21935
Revert "Added dracula theme style (#1636)"e411506
Prepare for 2.7.4 release.275e34d
doc: remove Perl 6 ref2e7e8c4
Fix several exponential/cubic complexity regexes found by Ben Caller/Doyenseceb39c43
xquery: fix pop from empty stack2738778
fix coding style in test_analyzer_lexer02e0f09
Added 'ERROR STOP' to fortran.py keywords. (#1665)c83fe48
support added for css variables (#1633)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.
Bumps pyyaml from 3.12 to 5.4.
Sourced from pyyaml's changelog.
5.4 (2021-01-19)
- yaml/pyyaml#407 -- Build modernization, remove distutils, fix metadata, build wheels, CI to GHA
- yaml/pyyaml#472 -- Fix for CVE-2020-14343, moves arbitrary python tags to UnsafeLoader
- yaml/pyyaml#441 -- Fix memory leak in implicit resolver setup
- yaml/pyyaml#392 -- Fix py2 copy support for timezone objects
- yaml/pyyaml#378 -- Fix compatibility with Jython
5.3.1 (2020-03-18)
- yaml/pyyaml#386 -- Prevents arbitrary code execution during python/object/new constructor
5.3 (2020-01-06)
- yaml/pyyaml#290 -- Use
is
instead of equality for comparing withNone
- yaml/pyyaml#270 -- Fix typos and stylistic nit
- yaml/pyyaml#309 -- Fix up small typo
- yaml/pyyaml#161 -- Fix handling of slots
- yaml/pyyaml#358 -- Allow calling add_multi_constructor with None
- yaml/pyyaml#285 -- Add use of safe_load() function in README
- yaml/pyyaml#351 -- Fix reader for Unicode code points over 0xFFFF
- yaml/pyyaml#360 -- Enable certain unicode tests when maxunicode not > 0xffff
- yaml/pyyaml#359 -- Use full_load in yaml-highlight example
- yaml/pyyaml#244 -- Document that PyYAML is implemented with Cython
- yaml/pyyaml#329 -- Fix for Python 3.10
- yaml/pyyaml#310 -- Increase size of index, line, and column fields
- yaml/pyyaml#260 -- Remove some unused imports
- yaml/pyyaml#163 -- Create timezone-aware datetimes when parsed as such
- yaml/pyyaml#363 -- Add tests for timezone
5.2 (2019-12-02)
- Repair incompatibilities introduced with 5.1. The default Loader was changed, but several methods like add_constructor still used the old default yaml/pyyaml#279 -- A more flexible fix for custom tag constructors yaml/pyyaml#287 -- Change default loader for yaml.add_constructor yaml/pyyaml#305 -- Change default loader for add_implicit_resolver, add_path_resolver
- Make FullLoader safer by removing python/object/apply from the default FullLoader yaml/pyyaml#347 -- Move constructor for object/apply to UnsafeConstructor
- Fix bug introduced in 5.1 where quoting went wrong on systems with sys.maxunicode <= 0xffff yaml/pyyaml#276 -- Fix logic for quoting special characters
- Other PRs: yaml/pyyaml#280 -- Update CHANGES for 5.1
5.1.2 (2019-07-30)
- Re-release of 5.1 with regenerated Cython sources to build properly for Python 3.8b2+
... (truncated)
58d0cb7
5.4 releasea60f7a1
Fix compatibility with Jythonee98abd
Run CI on PR base branch changesddf2033
constructor.timezone: _copy & deepcopyfc914d5
Avoid repeatedly appending to yaml_implicit_resolversa001f27
Fix for CVE-2020-14343fe15062
Add 3.9 to appveyor file for completeness sake1e1c7fb
Add a newline character to end of pyproject.toml0b6b7d6
Start sentences and phrases for capital lettersc976915
Shell code improvementsDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase
.