摘要:
Overview https://refactoring.guru/refactoring 把 dirty code 转变成 clean code 过程叫重构。 What is refactoring? Clean code clean code有如下特征: 可读性好 无重复逻辑 低代码 -- 包含
阅读全文
posted @ 2022-02-20 12:26
lightsong
阅读(250)
推荐(0)
摘要:
What's a design pattern? https://refactoring.guru/design-patterns/what-is-pattern 设计模式应对软件设计过程中经常出现的问题。 Design patterns are typical solutions to commo
阅读全文
posted @ 2022-02-20 11:16
lightsong
阅读(235)
推荐(0)
摘要:
absolute import https://realpython.com/absolute-vs-relative-python-imports/#absolute-imports 从项目根目录开始, 使用绝对路径 查找 package 或者 module An absolute import
阅读全文
posted @ 2022-02-17 14:13
lightsong
阅读(131)
推荐(0)
摘要:
LooseCoupling Requirement main文件中,调用底层同功能模块, 一般写法是在 main中,显示引用底层模块。 这构成了 下层对象 直接出现在上层代码中, 上层代码改变,需要考虑是否影响底层代码。 按照依赖倒置原则,需要定义中间抽象层,上层只依赖抽象层, 对底层,上层统一管理
阅读全文
posted @ 2022-02-14 17:03
lightsong
阅读(94)
推荐(0)
摘要:
InversionOfControl https://martinfowler.com/bliki/InversionOfControl.html 中文翻译,控制反转。 当你的软件控制逻辑变得复杂的时候, 控制层适合独立出来单独进行管理。 一些框架或者IOC容器,提供了这种能力。 所以确认一个软件包
阅读全文
posted @ 2022-02-13 18:09
lightsong
阅读(101)
推荐(0)
摘要:
Class attributes https://www.geeksforgeeks.org/class-instance-attributes-python/ 类属性,属于类自己,但是被所有的实例共享。 Class attributes belong to the class itself the
阅读全文
posted @ 2022-02-11 23:52
lightsong
阅读(289)
推荐(0)
摘要:
Cache https://xie.infoq.cn/article/373f75d884a28aff8f32c3d9a 什么是缓存? 缓存是将请求的结果存储在与原始存储位置或临时存储位置不同的位置的过程,这样我们就可以避免重复执行相同的操作。基本上,缓存是文件和数据的临时存储,从这个新位置访问数据
阅读全文
posted @ 2022-02-07 14:20
lightsong
阅读(78)
推荐(0)
摘要:
Overview https://devopscube.com/jenkins-architecture-explained/ master跟各种类型的worker node建立连接,有两种过程。 SSH负责master向slave(物理主机或者虚拟机)建立连接,然后推送agent.jar文件到此机
阅读全文
posted @ 2022-01-29 16:22
lightsong
阅读(268)
推荐(0)
摘要:
How To Run Docker in Docker Container [3 Easy Methods] https://devopscube.com/run-docker-in-docker/ 应用场景 在容器中执行完build动作, 需要将代码打入镜像中, 需要运行docker build命
阅读全文
posted @ 2022-01-28 18:28
lightsong
阅读(120)
推荐(0)
摘要:
背景 https://www.cnblogs.com/lightsong/p/15782809.html 书接前章,前面研究了使用K8S部署Jenkins master服务器的方法, 当时希望slave能力也能够利用K8S集群的来动态调度。 如下图: 将slave资源,以POD方式封装,动态调度到K
阅读全文
posted @ 2022-01-28 18:14
lightsong
阅读(416)
推荐(0)
摘要:
Docker & Kubernetes : Pods and Service definitions https://www.bogotobogo.com/DevOps/Docker/Docker_Kubernetes_Pods_Services_Yaml.php Kubernetes 是pilot
阅读全文
posted @ 2022-01-25 11:07
lightsong
阅读(182)
推荐(0)
摘要:
Services https://segmentfault.com/a/1190000023125587 左边从上到下,是依赖关系。 LoadBalancer是NodePort, 添加负载均衡特性。 NodePort是ClusterIP,添加在节点上开放接口功能。 ExternalName 对命名空
阅读全文
posted @ 2022-01-25 01:06
lightsong
阅读(111)
推荐(0)
摘要:
Python TypeError: ‘NoneType’ object is not subscriptable 对None进行脚本标注, 来获取值得写法,产生报错。 subscript 来源 于数学中, 对集合对象 进行索引子元素的写法 a1 其中的1是对a的脚注。 https://itsmyco
阅读全文
posted @ 2022-01-21 23:24
lightsong
阅读(640)
推荐(0)
摘要:
Proof of concept -- 可行性验证 https://en.wikipedia.org/wiki/Proof_of_concept Proof of concept (POC), also known as proof of principle, is a realization of
阅读全文
posted @ 2022-01-21 12:15
lightsong
阅读(454)
推荐(0)
摘要:
kubernetes https://kubernetes.io/ K8S是自动化部署,伸缩,容器应用的管理工具。 Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling,
阅读全文
posted @ 2022-01-10 00:00
lightsong
阅读(143)
推荐(0)
摘要:
GITOps https://www.gitops.tech/ 实现云原生应用自动化部署的方法 在运维基础设施时候,聚焦在开发行者中心的体验上, 使用开发者熟悉的工具, 例如git和其它持续发布工具。 GitOps is a way of implementing Continuous Deploy
阅读全文
posted @ 2021-12-29 15:41
lightsong
阅读(109)
推荐(0)
摘要:
Infrastructure as Code https://geekflare.com/infrastructure-as-code-intro/ 使用软件开发的原理和实践来实现基础设施的自动化。 写代码来管理 服务器 数据库 网络 日志 应用部署和配置。 Infrastructure as co
阅读全文
posted @ 2021-12-28 23:44
lightsong
阅读(234)
推荐(0)
摘要:
Scalable System Design Patterns== 可扩展系统设计模式 https://dzone.com/articles/scalable-system-design 负载均衡 分发器负责将请求根据不同的策略,分发到对应的worker实例上。 要求所有的worker上不存储状态信
阅读全文
posted @ 2021-12-27 17:26
lightsong
阅读(102)
推荐(0)
摘要:
Inner Loop vs Outer Loop https://opensource.com/article/21/6/open-source-developer-tools inner loop是开发者的最常做的事情, 编码 运行 验证 调试 outer loop是我们经常提及的CI/CD, 从
阅读全文
posted @ 2021-12-27 12:17
lightsong
阅读(116)
推荐(0)
摘要:
dispatcher https://hub.packtpub.com/dispatchers-and-routers/ 分发器,接收消息,分发到对应的模块进行处理。 Dispatchers In the real world, dispatchers are the communication c
阅读全文
posted @ 2021-12-23 17:04
lightsong
阅读(159)
推荐(0)
摘要:
Overview https://docs.docker.com/network/ docker强大之处在于实现资源隔离的同时,也可是构建容器连接,容器和容器(同主机),容器和容器(不同主机),或者容器和外部, One of the reasons Docker containers and ser
阅读全文
posted @ 2021-12-15 12:30
lightsong
阅读(172)
推荐(0)
摘要:
Jenkins Jobs status dashboard by Build Monitor Plugin https://www.devopsart.com/2020/05/jenkins-jobs-status-dashboard-by-build.html https://plugins.je
阅读全文
posted @ 2021-12-15 10:24
lightsong
阅读(193)
推荐(0)
摘要:
背景 同一个Jenkins服务器上,存在的Job越多,越需要进行归类管理。 View -- 分类 https://subscription.packtpub.com/book/application_development/9781784390891/3/ch03lvl1sec22/creating
阅读全文
posted @ 2021-12-14 17:03
lightsong
阅读(485)
推荐(0)
摘要:
CI/CD System https://www.redhat.com/en/topics/devops/what-is-ci-cd#ci/cd-tools CI关注开发阶段 CD -- Delivery 对应版本的自动化发布, 发布到制品库, 但是部署可能后续为手动 CD -- Deploymen
阅读全文
posted @ 2021-12-13 17:07
lightsong
阅读(304)
推荐(0)
摘要:
Pipeline as Code https://www.jenkins.io/doc/book/pipeline-as-code/ Pipeline as Code describes a set of features that allow Jenkins users to define pip
阅读全文
posted @ 2021-12-13 00:28
lightsong
阅读(132)
推荐(0)
摘要:
mysql & mysqldump https://serverguy.com/servers/how-to-backup-mysql-database/ 将数据库数据导出为 SQL语句。 mysqldump mysql-database > ABC-database-backup.sql mysq
阅读全文
posted @ 2021-12-07 14:31
lightsong
阅读(131)
推荐(0)
摘要:
marshmallow-sqlalchemy https://marshmallow-sqlalchemy.readthedocs.io/en/latest/ https://github.com/marshmallow-code/marshmallow-sqlalchemy SQLAlchemy
阅读全文
posted @ 2021-12-02 14:29
lightsong
阅读(635)
推荐(0)
摘要:
why need alembic? After defining ORM CLASS, we need to create table by the ORM class. https://docs.sqlalchemy.org/en/14/orm/tutorial.html#declare-a-ma
阅读全文
posted @ 2021-11-30 17:09
lightsong
阅读(154)
推荐(0)
摘要:
SQL COUNT() with GROUP by https://www.w3resource.com/sql/aggregate-functions/count-with-group-by.php The use of COUNT() function in conjunction with G
阅读全文
posted @ 2021-11-28 00:03
lightsong
阅读(586)
推荐(0)
摘要:
sqlalchemy https://www.sqlalchemy.org/ The Python SQL Toolkit and Object Relational Mapper SQLAlchemy is the Python SQL toolkit and Object Relational
阅读全文
posted @ 2021-11-26 15:20
lightsong
阅读(275)
推荐(0)
摘要:
django model https://docs.djangoproject.com/en/3.2/topics/db/models/ django的ORM工具, 具有非常简洁的接口,遵从django快速开发的理念。 但是此工具是跟django深度绑定的, 很难独立使用。 A model is t
阅读全文
posted @ 2021-11-22 00:16
lightsong
阅读(273)
推荐(0)
摘要:
Are locks unnecessary in multi-threaded Python code because of the GIL? https://stackoverflow.com/questions/105095/are-locks-unnecessary-in-multi-thre
阅读全文
posted @ 2021-11-14 18:28
lightsong
阅读(268)
推荐(0)
摘要:
Marking extra actions for routing https://www.django-rest-framework.org/api-guide/viewsets/#marking-extra-actions-for-routing ModelViewSet集成了 CRUD 所有功
阅读全文
posted @ 2021-11-13 22:51
lightsong
阅读(88)
推荐(0)
摘要:
lerna https://lerna.js.org/ https://github.com/lerna/lerna 对于规模大的项目, 使用单独一个库管理, 但是内部分为多个package的情况; 使用此工具管理。 Splitting up large codebases into separat
阅读全文
posted @ 2021-11-12 14:18
lightsong
阅读(103)
推荐(0)
摘要:
django migration https://docs.djangoproject.com/en/3.2/topics/migrations/ Migrations are Django’s way of propagating changes you make to your models (
阅读全文
posted @ 2021-11-09 12:32
lightsong
阅读(175)
推荐(0)
摘要:
react-sketch https://github.com/tbolis/react-sketch Sketch Tool for React-based applications, backed up by FabricJS tbolis.github.io/showcase/react-sk
阅读全文
posted @ 2021-11-09 10:46
lightsong
阅读(192)
推荐(0)
摘要:
Shell IO https://tecadmin.net/prompt-user-input-in-linux-shell-script/# Take Input on Termianl Let’s begin with input directly on terminal. Open a ter
阅读全文
posted @ 2021-11-04 09:51
lightsong
阅读(631)
推荐(0)
摘要:
mapDispatchToProps of react-redux https://react-redux.js.org/using-react-redux/connect-mapdispatch Two Forms of mapDispatchToProps The mapDispatchToP
阅读全文
posted @ 2021-11-01 16:04
lightsong
阅读(65)
推荐(0)
摘要:
echo模型 https://channels.readthedocs.io/en/stable/tutorial/part_2.html 浏览器请求, channels给响应。 receive回调接受消息, send接口发送响应消息 # chat/consumers.py import json
阅读全文
posted @ 2021-11-01 00:04
lightsong
阅读(87)
推荐(0)
摘要:
react-router-dom https://github.com/remix-run/react-router/blob/main/docs/getting-started/tutorial.md 对于location的变化, 不论是 hashtag方式, 或者是 通过pushstate改变u
阅读全文
posted @ 2021-10-31 22:29
lightsong
阅读(1022)
推荐(0)