├── .github
└── workflows
│ └── build_docker.yml
├── Dockerfile
├── LICENSE
├── README.md
├── cloud-agent-operator
├── README.md
├── deploy
│ ├── configmap.yaml
│ ├── crd-deploy.yaml
│ ├── crd.yaml
│ └── redis.yaml
├── example.full.yaml
└── example.min.yaml
├── codo-agent-darwin-arm
├── codo-agent-darwin-x86
├── codo-agent-linux-arm
├── codo-agent-linux-x86
├── codo-agent-server
├── codo-agent-win.exe
├── conf.yaml
├── img
├── 28fb5b67-0168-4da3-9af3-90435250fbf0.png
├── 2d-e4fd-4933-ac83-a82a8ac94ad5.png
├── 4f187f6b-7916-4177-8ec2-af89af2fabfd.jpeg
├── 4frd-e4fd-4933-ac83-a82a8a.png
├── 5098e991-311c-4b98-8813-6a372eaf40ec.png
├── 5cc70f6e-29af-419c-a5a9-fe1d42e73f21.png
├── 70f6e-29af-419c-a5a9-fe1d42e73.png
├── a9e48c16-44cd-4e7f-81b4-05a01b709e05.png
├── afb80896-0b83-4b90-b19a-ff8be025296d.png
├── b37311eb-bbf1-4b5c-88a4-811d8270cd72.png
├── dd219597-c5ed-4477-997f-554fcd08e016.png
├── de211ee2-4ba1-42b2-96c7-894a0e7dc7aa.png
├── de921cf5-3887-4674-bb74-ed9d94adafea.png
├── df95085a-6ab4-47df-a3d3-3b145de00698.png
└── e128a45d-e4fd-4933-ac83-a82a8ac94ad5.png
├── 安装文档.md
└── 更新日志.md
/.github/workflows/build_docker.yml:
--------------------------------------------------------------------------------
1 | name: Build and Push Docker Image to Alibaba Cloud
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - name: Checkout code
14 | uses: actions/checkout@v2
15 |
16 | - name: Login to Alibaba Cloud Container Registry
17 | env:
18 | DOCKER_REGISTRY: ${{ secrets.ALICLOUD_REGISTRY }}
19 | DOCKER_USERNAME: ${{ secrets.ALICLOUD_USERNAME }}
20 | DOCKER_PASSWORD: ${{ secrets.ALICLOUD_PASSWORD }}
21 | run: |
22 | echo $DOCKER_PASSWORD | docker login --username=$DOCKER_USERNAME --password-stdin $DOCKER_REGISTRY
23 | - name: Build Docker image
24 | run: docker build -t ${{ secrets.ALICLOUD_REGISTRY }}/ss1917/codo-agent-server:latest .
25 |
26 | - name: Push Docker image
27 | run: docker push ${{ secrets.ALICLOUD_REGISTRY }}/ss1917/codo-agent-server:latest
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | # Stage 1: 构建阶段
2 | #FROM golang:1.20 AS builder
3 | #
4 | #WORKDIR /src
5 | #ENV GO111MODULE=on
6 | #ENV GOPROXY="https://goproxy.cn,direct"
7 | #COPY ./go.mod /src
8 | #COPY ./go.sum /src
9 | #RUN go mod download
10 | #COPY . /src
11 | #RUN make build
12 |
13 | # Stage 2: 运行阶段
14 | FROM rockylinux:9.1
15 |
16 | MAINTAINER "shenshuo<191715030@qq.com>"
17 | # 设置编码
18 | ENV LANG C.UTF-8
19 |
20 | # 同步时间
21 | ENV TZ=Asia/Shanghai
22 |
23 | WORKDIR /data
24 | # 拷贝代码
25 | COPY codo-agent-server .
26 | # 用来拷贝配置文件
27 | COPY conf.yaml .
28 |
29 | RUN chmod +x codo-agent-server
30 |
31 | EXPOSE 8080 8081 8082 8083
32 |
33 | CMD ./codo-agent-server --config-file=conf.yaml
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # codo-agent-server
2 | 暂时只开放二进制文件,star 过万再开源
3 |
4 | ## 简介
5 | 本系统是 CoDo 平台的核心底层系统,作为 CoDo 服务体系与底层资源设施的连接器,支撑其他服务。它提供任务执行、文件传输、数据传输(包括指标采集、日志采集、链路采集和链路降采样)、代码仓库等基础能力。通过天门网关服务能力,向上层平台或 SaaS 提供服务,实现多种场景的赋能。
6 | 本系统已在多家知名游戏公司和国企中广泛应用多年,表现出安全、稳定、可靠和可控的特点。它不仅作为整个 CI/CD 流水线的基础支持,还承接底层网络和异地组网的功能,能够支持多种系统和平台,在不同地域和云厂商之间组网。目前,该系统已经成功覆盖了 CI/CD 流程中的所有构建服务器及线上线下的服务器。
7 | ## 架构图
8 | 
9 |
10 | ## 参考文档
11 | - [Agent安装文档](./安装文档.md)
12 | - [云原生 Agent安装文档](./cloud-agent-operator/README.md)
13 | - [更新日志](./更新日志.md)
14 |
15 |
16 | ## 服务端部署
17 | ## 服务端配置文件 `conf.yaml`
18 | 切记只有WS端口可以对外
19 | - [服务端配置文件](./conf.yaml)
20 | ## 初始化
21 | ```
22 | create database `codo_agent_server` default character set utf8mb4 collate utf8mb4_unicode_ci;
23 | codo-agent-server --config-file=config.yaml migrate
24 | ```
25 |
26 | ## 启动 server
27 | ```
28 | codo-agent-server --config-file=conf.yaml
29 | ```
30 | ## 启动 proxy (可选)
31 | ```
32 | codo-agent --url ws://127.0.0.1:9999/api/v1/codo/agent?clientId=8888 -s --log-dir /data/logs/codo --client-type master
33 | ```
34 | ## 启动 agent
35 | ```
36 | # 直连
37 | codo-agent --url ws://127.0.0.1:9999/api/v1/codo/agent?clientId=codo-test -s --log-dir /data/logs/codo --row-limit 2000 --client-type normal
38 | # 代理
39 | codo-agent --url ws://127.0.0.1:20800/api/v1/codo/agent?clientId=codo-test:8888 -s --log-dir /data/logs/codo --row-limit 2000 --client-type normal
40 | ```
41 | ## 启动 云原生agent
42 | 详情看 [云原生agent](./cloud-agent-operator/README.md)
--------------------------------------------------------------------------------
/cloud-agent-operator/README.md:
--------------------------------------------------------------------------------
1 | # cloud-agent-operator
2 |
3 | 云原生的 agent-server 任务执行器
4 |
5 | ## 快速开始
6 |
7 | ### 配置
8 | - configmap 里的 `SERVER-ADDRESS` 参数 指向 agent-server 的地址
9 | - configmap 里的 `BIZ-ID` 参数 配置为对应业务的 ID
10 |
11 | ### 安装
12 | ```shell
13 | kubectl apply -f ./deploy/crd.yaml
14 | kubectl apply -f ./deploy/crd-deploy.yaml
15 | kubectl -n cloud-agent-operator-system apply -f ./deploy/redis.yaml
16 | kubectl -n cloud-agent-operator-system apply -f ./deploy/configmap.yaml
17 | ```
18 |
19 | ## 快速使用
20 | - [必填] taskId 任务ID (唯一)
21 | - [必填] taskType 任务类型 (CloudTask)
22 | - [必填] agentID 用于执行云原生任务的 AgentID
23 | - [必填] taskYaml 脚本的定义, 详情见后面的配置
24 | - [必填] taskYaml 脚本的定义, 详情见后面的配置
25 | - [可选] timeout 超时时间(秒)(默认600秒)
26 | - [可选] scriptParams 脚本使用的参数, 通过环境变量添加 `codo_` 前缀注入( abc 在环境变量中是 $codo_abc)
27 | - [可选] namespace 脚本执行的命名空间, 默认为 default
28 |
29 | ```shell
30 | curl -X POST {agent-server-http-addr}/api/v1/agent/task/batch \
31 | -H 'Content-Type: application/json' \
32 | -d '[
33 | {
34 | "taskId": "task123",
35 | "taskType": "CloudTask",
36 | "agentId": "agent456",
37 | "args": {
38 | "timeout": 60,
39 | "scriptParams": "{\"abc\": \"1\"}",
40 | "namespace": "default",
41 | "taskYaml": "# [必选] 任务定义\ntaskSpec:\n # [必选] 任务展示名称\n displayName: \"cc-test\"\n\n # [必选] 任务步骤定义\n # 任务有两种模式(只能选其一)\n # - script 模式:\n # - command 模式:\n steps:\n # [必选] 步骤名称\n - name: \"step1\"\n # [可选] 超时时间(默认60分钟)\n # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,\n # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。\n timeout: \"10s\"\n # [必选] 任务运行所处的镜像\n image: \"ccr.ccs.tencentyun.com/library/alpine:latest\"\n # [必选] 运行的脚本(与 command 二选一)\n script: |\n #!/bin/sh\n echo \"Hello World step1 FOO=$FOO\"\n - name: \"step2\"\n image: \"ccr.ccs.tencentyun.com/library/alpine:latest\"\n # [必选] 指定命令执行(与 script 二选一)\n command: [ codo ]\n args: [ \"set-context\", \"abc=123\" ]\n - name: \"step3\"\n image: \"ccr.ccs.tencentyun.com/library/alpine:latest\"\n script: |\n #!/bin/python\n import os\n print(\"Hello World step3 FOO=%s\" % os.environ.get(\"FOO\"))"
42 | }
43 | }
44 | ]'
45 | ```
46 |
47 | ## [简单任务定义](example.min.yaml)
48 | ```yaml
49 | # [必选] 任务定义
50 | taskSpec:
51 | # [必选] 任务展示名称
52 | displayName: "cc-test"
53 |
54 | # [必选] 任务步骤定义
55 | # 任务有两种模式(只能选其一)
56 | # - script 模式:
57 | # - command 模式:
58 | steps:
59 | # [必选] 步骤名称
60 | - name: "step1"
61 | # [可选] 超时时间(默认60分钟)
62 | # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,
63 | # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。
64 | timeout: "10s"
65 | # [必选] 任务运行所处的镜像
66 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
67 | # [必选] 运行的脚本(与 command 二选一)
68 | script: |
69 | #!/bin/sh
70 | echo "Hello World step1 FOO=$FOO"
71 | - name: "step2"
72 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
73 | # [必选] 指定命令执行(与 script 二选一)
74 | command: [ codo ]
75 | args: [ "set-context", "abc=123" ]
76 | - name: "step3"
77 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
78 | script: |
79 | #!/bin/python
80 | import os
81 | print("Hello World step3 FOO=%s" % os.environ.get("FOO"))
82 |
83 | ```
84 |
85 | ## [全量任务定义](example.full.yaml)
86 | ```yaml
87 | # [可选] pod 的资源限制
88 | # 用户可以选择在任务级指定资源需求,而不是在每个 Step 上指定资源需求。如果用户指定了任务级资源要求,
89 | # 它将确保 kubelet 只为执行 Task 的 Steps 保留该数量的资源。如果用户指定了任务级资源限制,则任何 Step 都不能使用超过该数量的资源。
90 | computeResources:
91 | requests:
92 | memory: "128Mi" # 申请 512 MB 的内存
93 | cpu: "60m" # 申请 1 Core 的 CPU
94 |
95 | # [可选] 预计生成的 pod 的要求
96 | podTemplate:
97 | # [可选] NodeSelector 是一个选择器,它必须为 true 才能使 pod 适合节点。
98 | # 它必须与要在该节点上调度 pod 的节点标签相匹配。更多信息:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
99 | nodeSelector: { }
100 | # [可选] pod 的环境变量
101 | env: [ ]
102 | # [可选] 此 Toleration 附加到的 pod 可以容忍使用匹配运算符 与三元组 匹配的任何污点。
103 | tolerations:
104 | - key: "key"
105 | operator: "Equal"
106 | value: "value"
107 | effect: "NoSchedule"
108 | # [可选] pod 亲缘性配置
109 | # 更多信息:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
110 | affinity:
111 | nodeAffinity:
112 | requiredDuringSchedulingIgnoredDuringExecution:
113 | nodeSelectorTerms:
114 | - matchExpressions:
115 | - key: kubernetes.io/e2e-az-name
116 | operator: In
117 | values:
118 | - e2e-az1
119 | preferredDuringSchedulingIgnoredDuringExecution:
120 | - weight: 1
121 | preference:
122 | matchExpressions:
123 | - key: another-node-label-key
124 | operator: In
125 | values:
126 | - another-node-label-value
127 | podAffinity:
128 | requiredDuringSchedulingIgnoredDuringExecution:
129 | - labelSelector:
130 | matchExpressions:
131 | - key: security
132 | operator: In
133 | values:
134 | - S1
135 | topologyKey: failure-domain.beta.kubernetes.io/zone
136 | podAntiAffinity:
137 | requiredDuringSchedulingIgnoredDuringExecution:
138 | - labelSelector:
139 | matchExpressions:
140 | - key: security
141 | operator: In
142 | values:
143 | - S1
144 | topologyKey: failure-domain.beta.kubernetes.io/zone
145 |
146 | # [可选] SecurityContext 保存 Pod 级别的安全属性和通用容器设置。默认为空。每个字段的默认值请参阅类型说明。
147 | securityContext:
148 | runAsNonRoot: true
149 | runAsUser: 1001
150 | # [可选] 属于 pod 的容器可以挂载的卷列表。更多信息:https://kubernetes.io/docs/concepts/storage/volumes
151 | volumes:
152 | - name: my-cache
153 | persistentVolumeClaim:
154 | claimName: my-volume-claim
155 | # [可选] 设置容器的运行时类名
156 | # RuntimeClassName 指的是 node.k8s.io 组中的一个 RuntimeClass 对象,
157 | # 该对象应该用于运行这个 pod。如果没有 RuntimeClass 资源
158 | # 匹配指定的类名,则该 pod 将不会运行。如果未设置或为空,将
159 | # 使用"legacy"(遗留)RuntimeClass,这是一个隐式类,其定义为空,
160 | # 使用默认的运行时处理程序。
161 | # 更多信息: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md
162 | # 这是 Kubernetes v1.14 版本中的一个 beta 特性。
163 | runtimeClassName: "runc"
164 |
165 | # [可选] AutomountServiceAccountToken 指示以此服务帐户运行的 Pod 是否应自动挂载 API 令牌。可以在 Pod 级别覆盖。
166 | automountServiceAccountToken: false
167 | # [可选] Pod 设置 DNS 策略。默认为“ClusterFirst”。有效值为
168 | # “ClusterFirstWithHostNet”、“ClusterFirst”、“默认”或“无”。
169 | # DNSConfig 中给出的 DNS 参数将与使用 DNSPolicy 选择的策略合并。
170 | # 要将 DNS 选项与 hostNetwork 一起设置,您必须将 DNS 策略显式指定为“ClusterFirstWithHostNet”。
171 | dnsPolicy: ""
172 | # [可选] 指定 Pod 的 DNS 参数。此处指定的参数将合并到基于 DNSPolicy 生成的 DNS 配置中。
173 | dnsConfig:
174 | nameservers: # DNS 名称服务器 IP 地址的列表。这将被附加到从 DNSPolicy 生成的基本名称服务器中。重复的名称服务器将被删除。
175 | - "8.8.8.8"
176 | searches: # 用于主机名查找的 DNS 搜索域列表。这将被附加到从 DNSPolicy 生成的基本搜索路径中。重复的搜索路径将被删除。
177 | - "svc.cluster.local"
178 | options: # DNS 解析器选项列表。这将与 DNSPolicy 生成的基本选项合并。重复的条目将被删除。选项中给出的解析选项将覆盖基本 DNSPolicy 中出现的解析选项。
179 | - name: "ndots"
180 | value: "2"
181 | # [可选] EnableServiceLinks 指示是否应将有关服务的信息注入到 pod 的环境变量中,与 Docker 链接的语法相匹配。可选:默认为 true。
182 | enableServiceLinks: true
183 | # [可选] 设置容器的优先级类名
184 | # - 如果指定,则指示 Pod 的优先级。 “system-node-key”和“system-cluster-key”是两个特殊的关键字,
185 | # 表示最高优先级,前者为最高优先级。任何其他名称必须通过创建具有该名称的 PriorityClass 对象来定义。
186 | # - 如果未指定,Pod 优先级将为默认值;如果没有默认值,则 Pod 优先级为零。
187 | priorityClassName: ""
188 | # [可选] 设置容器的调度策略
189 | schedulerName: "default-scheduler"
190 | # [可选] ImagePullSecrets 是对同一命名空间中 Secrets 的引用的可选列表,用于拉取此 PodSpec 使用的任何镜像。
191 | # 如果指定,这些 Secrets 将传递给各个拉取器实现以供他们使用。
192 | # 更多信息:https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
193 | imagePullSecrets:
194 | - name: my-secret # 引用对象名, 参考: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
195 | # [可选] HostAliases 是一个可选的主机和 IP 列表,如果指定,将被注入到 Pod 的主机文件中。这仅对非 hostNetwork pod 有效。
196 | hostAliases:
197 | - ip: ""
198 | hostnames: [ "" ]
199 | # [可选] 此 Pod 请求主机网络。使用主机的网络命名空间。如果设置此选项,则必须指定将使用的端口。默认为 false。
200 | hostNetwork: false
201 | # [可选] TopologySpreadConstraints 描述一组 Pod 应如何跨拓扑域分布。调度程序将以遵守约束的方式调度 Pod。所有topologySpreadConstraints 都是AND 运算。
202 | # corev1.TopologySpreadConstraint
203 | topologySpreadConstraints:
204 | - maxSkew: 1
205 | topologyKey: kubernetes.io/hostname
206 | whenUnsatisfiable: DoNotSchedule
207 | labelSelector:
208 | matchLabels:
209 | app: myapp
210 | namespaces:
211 | - mynamespace
212 |
213 |
214 | # [可选] 超时时间(默认60分钟)
215 | # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,
216 | # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。
217 | timeout: "10m" # 10分钟
218 |
219 |
220 | # [必选] 任务定义
221 | taskSpec:
222 | # [必选] 任务展示名称
223 | displayName: "cc-test"
224 | # [可选] 描述
225 | description: "这是一份描述"
226 | # [可选] 存储定义
227 | # 除了为输入和输出资源隐式创建的卷之外,指定一个或多个 Volumes ,以便 Task 中的 Steps 执行。
228 | volumes:
229 | - name: my-volume
230 | emptyDir: { }
231 |
232 | # [必选] 任务步骤定义
233 | # 任务有两种模式(只能选其一)
234 | # - script 模式:
235 | # - command 模式:
236 | steps:
237 | # [必选] 步骤名称
238 | - name: "step1"
239 | # [可选] 超时时间(默认60分钟)
240 | # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,
241 | # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。
242 | timeout: "10s"
243 | # [必选] 任务运行所处的镜像
244 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
245 | # [可选] 镜像拉取策略
246 | # [Always | Never | IfNotPresent]
247 | # 如果 tag 是 :latest ,则 默认是 Always , 其他情况的 tag , 默认都是 IfNotPresent
248 | imagePullPolicy: "IfNotPresent"
249 | # [可选] 指定环境变量, 这里的环境变量是静态的, 会和 codo 的参数进行合并, 如果 key 冲突时, 以 codo 的参数为准
250 | env:
251 | - name: "FOO"
252 | value: "baz"
253 | # [可选] 指定 step容器 的资源需求
254 | # 所有 step 的配置必须加起来小于 pod 的配置
255 | # 这里的配置会在上层被覆盖, key 级别覆盖, 例如上层只指定 memory: 128Mi, 则 cpu 还是按照 500m 来使用
256 | computeResources:
257 | requests:
258 | memory: "256Mi" # 申请 256 MB 的内存
259 | cpu: "500m" # 申请 0.5 Core 的 CPU
260 | # [可选] 工作目录
261 | workingDir: /data
262 | # [可选] 当 step 出错时的处理方式
263 | # [ continue | stopAndFail ]
264 | onError: stopAndFail
265 | # [可选] securityContext 是 Kubernetes 和 Tekton 中的一个重要配置,用于设置容器的安全上下文。
266 | # 在 Step 中,securityContext 可以用来控制容器的权限和行为。
267 | # securityContext:
268 | # runAsUser: 1000
269 | # runAsGroup: 3000
270 | # fsGroup: 2000
271 | # allowPrivilegeEscalation: false
272 | # privileged: false
273 | # capabilities:
274 | # drop:
275 | # - ALL
276 | # readOnlyRootFilesystem: true
277 | # [可选] 挂载存储
278 | volumeMounts:
279 | - name: my-volume
280 | mountPath: /data
281 | # [必选] 运行的脚本(与 command 二选一)
282 | script: |
283 | #!/bin/sh
284 | echo "Hello World step1 FOO=$FOO"
285 | - name: "step2"
286 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
287 | # [必选] 指定命令执行(与 script 二选一)
288 | command: [ codo ]
289 | args: [ "set-context", "abc=123" ]
290 | - name: "step3"
291 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
292 | script: |
293 | #!/bin/sh
294 | echo "context=====$(codo get-context abc)"
295 | - name: "step4-python-test"
296 | image: "harbor.123u.com/public/rocky9.1-python3:latest"
297 | script: |
298 | #!/bin/python3.9
299 | from floating import Floating
300 | # 请手动指定,调用api模式。
301 | fl = Floating(api_mode=True)
302 | fl.logger.info("hello world")
303 | ```
--------------------------------------------------------------------------------
/cloud-agent-operator/deploy/configmap.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: v1
2 | kind: ConfigMap
3 | metadata:
4 | name: cloud-agent-operator-config
5 | data:
6 | config.yaml: |
7 | # agent 配置
8 | agentConfig:
9 | # 日志等级
10 | LOG-LEVEL: "debug"
11 | # RootPath 日志保存路径
12 | # 用于:
13 | # - 存储脚本文件
14 | # - 存储密钥文件
15 | # - 存储执行日志文件
16 | # - 存储agent日志文件
17 | ROOT-PATH: "/data/codo-agent"
18 | # 连接服务地址
19 | SERVER-ADDRESS: "ws://127.0.0.1:9999/api/v1/codo/agent?clientId=cloud-agent-operator:6666" # jamieyu测试环境
20 | # 节点类型,当节点为master时,自动开启代理模式
21 | NODE-TYPE: "operator"
22 | # 业务ID
23 | BIZ-ID: "525"
24 | # 本地绑定ip(master模式),本地上报ip地址
25 | BIND-IP: ""
26 | # 本地绑定端口(master模式)
27 | BIND-PORT: 20800
28 | # 日志行数限制
29 | ROW-LIMIT: 2000
30 | # 最大执行命令数
31 | MAX-EXEC-CMD: 100
32 | # 以脚本路径作为工作目录
33 | SCRIPT-PATH-AS-WD: false
34 | # 强指脚本的工作目录
35 | WORK-DIR: "/data/codo-work-dir"
36 | # 日志清理间隔(单位:天)
37 | LOG-CLEAN-INTERVAL: 30
38 |
39 | # redis 配置(用于领域事件分发, 以及数据缓存)
40 | redisConfig:
41 | # 地址
42 | addr: "redis-service:6379"
43 | # 密码
44 | password: ""
45 | # 数据库 index
46 | db: 1
47 |
48 | # 可观测性配置
49 | otel:
50 | # 日志配置
51 | log:
52 | # 日志等级 DEBUG, INFO, WARN, ERROR, FATAL
53 | level: "DEBUG"
54 | # 日志格式 json, console
55 | encoding:
56 | # 日志文件路径
57 | filepath: "/data/codo-work-dir/codo-agent.log"
58 | # 日志文件切割大小(单位: MB)(默认 100MB)
59 | maxSize: 100
60 | # 日志文件切割周期(单位: 天)(默认 7天)
61 | maxAge: 7
62 | # 日志文件最大保留个数(单位: 个)(默认 10个)
63 | maxBackups: 10
64 | # 链路追踪配置(可以不开, 不采集的话)
65 | trace:
66 | # jaeger 配置 的 endpoint
67 | endpoint: ""
68 | # endpoint 是否是 https
69 | insecure: true
70 | # 数据指标
71 | metrics:
72 | # 开启 exemplar
73 | enableExemplar: true
74 | # 镜像配置, 用于 cloud-agent 的运行时
75 | imagesConfig:
76 | # 运行时镜像(很重要)
77 | entrypointImage: registry.cn-shanghai.aliyuncs.com/ss1917/cloud-agent-operator:v0.0.1
--------------------------------------------------------------------------------
/cloud-agent-operator/deploy/redis.yaml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: apps/v1
3 | kind: Deployment
4 | metadata:
5 | name: redis-deployment
6 | labels:
7 | app: redis
8 | spec:
9 | replicas: 1
10 | selector:
11 | matchLabels:
12 | app: redis
13 | template:
14 | metadata:
15 | labels:
16 | app: redis
17 | spec:
18 | containers:
19 | - name: redis
20 | image: ccr.ccs.tencentyun.com/library/redis:latest
21 | ports:
22 | - containerPort: 6379
23 | resources:
24 | limits:
25 | cpu: "256m"
26 | memory: "512Mi"
27 | requests:
28 | cpu: "10m"
29 | memory: "256Mi"
30 | ---
31 | apiVersion: v1
32 | kind: Service
33 | metadata:
34 | name: redis-service
35 | spec:
36 | selector:
37 | app: redis
38 | ports:
39 | - protocol: TCP
40 | port: 6379
41 | targetPort: 6379
--------------------------------------------------------------------------------
/cloud-agent-operator/example.full.yaml:
--------------------------------------------------------------------------------
1 | # [可选] pod 的资源限制
2 | # 用户可以选择在任务级指定资源需求,而不是在每个 Step 上指定资源需求。如果用户指定了任务级资源要求,
3 | # 它将确保 kubelet 只为执行 Task 的 Steps 保留该数量的资源。如果用户指定了任务级资源限制,则任何 Step 都不能使用超过该数量的资源。
4 | computeResources:
5 | requests:
6 | memory: "128Mi" # 申请 512 MB 的内存
7 | cpu: "60m" # 申请 1 Core 的 CPU
8 |
9 | # [可选] 预计生成的 pod 的要求
10 | podTemplate:
11 | # [可选] NodeSelector 是一个选择器,它必须为 true 才能使 pod 适合节点。
12 | # 它必须与要在该节点上调度 pod 的节点标签相匹配。更多信息:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
13 | nodeSelector: { }
14 | # [可选] pod 的环境变量
15 | env: [ ]
16 | # [可选] 此 Toleration 附加到的 pod 可以容忍使用匹配运算符 与三元组 匹配的任何污点。
17 | tolerations:
18 | - key: "key"
19 | operator: "Equal"
20 | value: "value"
21 | effect: "NoSchedule"
22 | # [可选] pod 亲缘性配置
23 | # 更多信息:https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
24 | affinity:
25 | nodeAffinity:
26 | requiredDuringSchedulingIgnoredDuringExecution:
27 | nodeSelectorTerms:
28 | - matchExpressions:
29 | - key: kubernetes.io/e2e-az-name
30 | operator: In
31 | values:
32 | - e2e-az1
33 | preferredDuringSchedulingIgnoredDuringExecution:
34 | - weight: 1
35 | preference:
36 | matchExpressions:
37 | - key: another-node-label-key
38 | operator: In
39 | values:
40 | - another-node-label-value
41 | podAffinity:
42 | requiredDuringSchedulingIgnoredDuringExecution:
43 | - labelSelector:
44 | matchExpressions:
45 | - key: security
46 | operator: In
47 | values:
48 | - S1
49 | topologyKey: failure-domain.beta.kubernetes.io/zone
50 | podAntiAffinity:
51 | requiredDuringSchedulingIgnoredDuringExecution:
52 | - labelSelector:
53 | matchExpressions:
54 | - key: security
55 | operator: In
56 | values:
57 | - S1
58 | topologyKey: failure-domain.beta.kubernetes.io/zone
59 |
60 | # [可选] SecurityContext 保存 Pod 级别的安全属性和通用容器设置。默认为空。每个字段的默认值请参阅类型说明。
61 | securityContext:
62 | runAsNonRoot: true
63 | runAsUser: 1001
64 | # [可选] 属于 pod 的容器可以挂载的卷列表。更多信息:https://kubernetes.io/docs/concepts/storage/volumes
65 | volumes:
66 | - name: my-cache
67 | persistentVolumeClaim:
68 | claimName: my-volume-claim
69 | # [可选] 设置容器的运行时类名
70 | # RuntimeClassName 指的是 node.k8s.io 组中的一个 RuntimeClass 对象,
71 | # 该对象应该用于运行这个 pod。如果没有 RuntimeClass 资源
72 | # 匹配指定的类名,则该 pod 将不会运行。如果未设置或为空,将
73 | # 使用"legacy"(遗留)RuntimeClass,这是一个隐式类,其定义为空,
74 | # 使用默认的运行时处理程序。
75 | # 更多信息: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md
76 | # 这是 Kubernetes v1.14 版本中的一个 beta 特性。
77 | runtimeClassName: "runc"
78 |
79 | # [可选] AutomountServiceAccountToken 指示以此服务帐户运行的 Pod 是否应自动挂载 API 令牌。可以在 Pod 级别覆盖。
80 | automountServiceAccountToken: false
81 | # [可选] Pod 设置 DNS 策略。默认为“ClusterFirst”。有效值为
82 | # “ClusterFirstWithHostNet”、“ClusterFirst”、“默认”或“无”。
83 | # DNSConfig 中给出的 DNS 参数将与使用 DNSPolicy 选择的策略合并。
84 | # 要将 DNS 选项与 hostNetwork 一起设置,您必须将 DNS 策略显式指定为“ClusterFirstWithHostNet”。
85 | dnsPolicy: ""
86 | # [可选] 指定 Pod 的 DNS 参数。此处指定的参数将合并到基于 DNSPolicy 生成的 DNS 配置中。
87 | dnsConfig:
88 | nameservers: # DNS 名称服务器 IP 地址的列表。这将被附加到从 DNSPolicy 生成的基本名称服务器中。重复的名称服务器将被删除。
89 | - "8.8.8.8"
90 | searches: # 用于主机名查找的 DNS 搜索域列表。这将被附加到从 DNSPolicy 生成的基本搜索路径中。重复的搜索路径将被删除。
91 | - "svc.cluster.local"
92 | options: # DNS 解析器选项列表。这将与 DNSPolicy 生成的基本选项合并。重复的条目将被删除。选项中给出的解析选项将覆盖基本 DNSPolicy 中出现的解析选项。
93 | - name: "ndots"
94 | value: "2"
95 | # [可选] EnableServiceLinks 指示是否应将有关服务的信息注入到 pod 的环境变量中,与 Docker 链接的语法相匹配。可选:默认为 true。
96 | enableServiceLinks: true
97 | # [可选] 设置容器的优先级类名
98 | # - 如果指定,则指示 Pod 的优先级。 “system-node-key”和“system-cluster-key”是两个特殊的关键字,
99 | # 表示最高优先级,前者为最高优先级。任何其他名称必须通过创建具有该名称的 PriorityClass 对象来定义。
100 | # - 如果未指定,Pod 优先级将为默认值;如果没有默认值,则 Pod 优先级为零。
101 | priorityClassName: ""
102 | # [可选] 设置容器的调度策略
103 | schedulerName: "default-scheduler"
104 | # [可选] ImagePullSecrets 是对同一命名空间中 Secrets 的引用的可选列表,用于拉取此 PodSpec 使用的任何镜像。
105 | # 如果指定,这些 Secrets 将传递给各个拉取器实现以供他们使用。
106 | # 更多信息:https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
107 | imagePullSecrets:
108 | - name: my-secret # 引用对象名, 参考: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
109 | # [可选] HostAliases 是一个可选的主机和 IP 列表,如果指定,将被注入到 Pod 的主机文件中。这仅对非 hostNetwork pod 有效。
110 | hostAliases:
111 | - ip: ""
112 | hostnames: [ "" ]
113 | # [可选] 此 Pod 请求主机网络。使用主机的网络命名空间。如果设置此选项,则必须指定将使用的端口。默认为 false。
114 | hostNetwork: false
115 | # [可选] TopologySpreadConstraints 描述一组 Pod 应如何跨拓扑域分布。调度程序将以遵守约束的方式调度 Pod。所有topologySpreadConstraints 都是AND 运算。
116 | # corev1.TopologySpreadConstraint
117 | topologySpreadConstraints:
118 | - maxSkew: 1
119 | topologyKey: kubernetes.io/hostname
120 | whenUnsatisfiable: DoNotSchedule
121 | labelSelector:
122 | matchLabels:
123 | app: myapp
124 | namespaces:
125 | - mynamespace
126 |
127 |
128 | # [可选] 超时时间(默认60分钟)
129 | # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,
130 | # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。
131 | timeout: "10m" # 10分钟
132 |
133 |
134 | # [必选] 任务定义
135 | taskSpec:
136 | # [必选] 任务展示名称
137 | displayName: "cc-test"
138 | # [可选] 描述
139 | description: "这是一份描述"
140 | # [可选] 存储定义
141 | # 除了为输入和输出资源隐式创建的卷之外,指定一个或多个 Volumes ,以便 Task 中的 Steps 执行。
142 | volumes:
143 | - name: my-volume
144 | emptyDir: { }
145 |
146 | # [必选] 任务步骤定义
147 | # 任务有两种模式(只能选其一)
148 | # - script 模式:
149 | # - command 模式:
150 | steps:
151 | # [必选] 步骤名称
152 | - name: "step1"
153 | # [可选] 超时时间(默认60分钟)
154 | # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,
155 | # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。
156 | timeout: "10s"
157 | # [必选] 任务运行所处的镜像
158 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
159 | # [可选] 镜像拉取策略
160 | # [Always | Never | IfNotPresent]
161 | # 如果 tag 是 :latest ,则 默认是 Always , 其他情况的 tag , 默认都是 IfNotPresent
162 | imagePullPolicy: "IfNotPresent"
163 | # [可选] 指定环境变量, 这里的环境变量是静态的, 会和 codo 的参数进行合并, 如果 key 冲突时, 以 codo 的参数为准
164 | env:
165 | - name: "FOO"
166 | value: "baz"
167 | # [可选] 指定 step容器 的资源需求
168 | # 所有 step 的配置必须加起来小于 pod 的配置
169 | # 这里的配置会在上层被覆盖, key 级别覆盖, 例如上层只指定 memory: 128Mi, 则 cpu 还是按照 500m 来使用
170 | computeResources:
171 | requests:
172 | memory: "256Mi" # 申请 256 MB 的内存
173 | cpu: "500m" # 申请 0.5 Core 的 CPU
174 | # [可选] 工作目录
175 | workingDir: /data
176 | # [可选] 当 step 出错时的处理方式
177 | # [ continue | stopAndFail ]
178 | onError: stopAndFail
179 | # [可选] securityContext 是 Kubernetes 和 Tekton 中的一个重要配置,用于设置容器的安全上下文。
180 | # 在 Step 中,securityContext 可以用来控制容器的权限和行为。
181 | # securityContext:
182 | # runAsUser: 1000
183 | # runAsGroup: 3000
184 | # fsGroup: 2000
185 | # allowPrivilegeEscalation: false
186 | # privileged: false
187 | # capabilities:
188 | # drop:
189 | # - ALL
190 | # readOnlyRootFilesystem: true
191 | # [可选] 挂载存储
192 | volumeMounts:
193 | - name: my-volume
194 | mountPath: /data
195 | # [必选] 运行的脚本(与 command 二选一)
196 | script: |
197 | #!/bin/sh
198 | echo "Hello World step1 FOO=$FOO"
199 | - name: "step2"
200 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
201 | # [必选] 指定命令执行(与 script 二选一)
202 | command: [ codo ]
203 | args: [ "set-context", "abc=123" ]
204 | - name: "step3"
205 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
206 | script: |
207 | #!/bin/sh
208 | echo "context=====$(codo get-context abc)"
209 | - name: "step4-python-test"
210 | image: "harbor.123u.com/public/rocky9.1-python3:latest"
211 | script: |
212 | #!/bin/python3.9
213 | from floating import Floating
214 | # 请手动指定,调用api模式。
215 | fl = Floating(api_mode=True)
216 | fl.logger.info("hello world")
--------------------------------------------------------------------------------
/cloud-agent-operator/example.min.yaml:
--------------------------------------------------------------------------------
1 | # [必选] 任务定义
2 | taskSpec:
3 | # [必选] 任务展示名称
4 | displayName: "cc-test"
5 |
6 | # [必选] 任务步骤定义
7 | # 任务有两种模式(只能选其一)
8 | # - script 模式:
9 | # - command 模式:
10 | steps:
11 | # [必选] 步骤名称
12 | - name: "step1"
13 | # [可选] 超时时间(默认60分钟)
14 | # 持续时间字符串是可能有符号的十进制数字序列,每个十进制数字都带有可选的分数和单位后缀,
15 | # 例如“300ms”、“-1.5h”或“2h45m”。有效的时间单位为“ns”、“us”(或“μs”)、“ms”、“s”、“m”、“h”。
16 | timeout: "10s"
17 | # [必选] 任务运行所处的镜像
18 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
19 | # [必选] 运行的脚本(与 command 二选一)
20 | script: |
21 | #!/bin/sh
22 | echo "Hello World step1 FOO=$FOO"
23 | - name: "step2"
24 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
25 | # [必选] 指定命令执行(与 script 二选一)
26 | command: [ codo ]
27 | args: [ "set-context", "abc=123" ]
28 | - name: "step3"
29 | image: "ccr.ccs.tencentyun.com/library/alpine:latest"
30 | script: |
31 | #!/bin/python
32 | import os
33 | print("Hello World step3 FOO=%s" % os.environ.get("FOO"))
--------------------------------------------------------------------------------
/codo-agent-darwin-arm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/codo-agent-darwin-arm
--------------------------------------------------------------------------------
/codo-agent-darwin-x86:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/codo-agent-darwin-x86
--------------------------------------------------------------------------------
/codo-agent-linux-arm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/codo-agent-linux-arm
--------------------------------------------------------------------------------
/codo-agent-linux-x86:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/codo-agent-linux-x86
--------------------------------------------------------------------------------
/codo-agent-server:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/codo-agent-server
--------------------------------------------------------------------------------
/codo-agent-win.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/codo-agent-win.exe
--------------------------------------------------------------------------------
/conf.yaml:
--------------------------------------------------------------------------------
1 | # (必填) HTTP 服务端口
2 | PORT: 8080
3 | # (必填) websocket 连接专用端口
4 | WS-PORT: 8081
5 | # (推荐配置) 性能采集端口
6 | PPROF-PORT: 8082
7 | # (推荐配置) 指标采集端口
8 | PROM-PORT: 8083
9 | # (可以不填) GRPC 通信端口(暂时没用)
10 | RPC-PORT: 8084
11 | # (必填) 本机服务监听地址
12 | BIND-ADDRESS: 0.0.0.0
13 |
14 |
15 | # (必填) 日志存放文件夹
16 | ROOT-PATH: E:\go\src\agent-server
17 | # (必填) 日志等级
18 | LOG-LEVEL: DEBUG
19 |
20 |
21 |
22 | # (必填) MYSQL 配置 用于数据备份存储
23 | DB-CONFIG:
24 | DB-TYPE: mysql
25 | DB-USER: root
26 | DB-PASSWORD: 123456
27 | DB-HOST: 127.0.0.1
28 | DB-NAME: codo_agent_server
29 | DB-TABLE-PREFIX: codo_
30 | DB-FILE: ""
31 | DB-PORT: 3306
32 |
33 |
34 | # (必填) REDIS 配置 用于实时数据存储
35 | REDIS:
36 | R-HOST: 127.0.0.1
37 | R-PORT: 6379
38 | R-PASSWORD: ""
39 | R-DB: 1
40 |
41 | # (推荐配置) RABBIT MQ配置
42 | MQCONFIG:
43 | # 如果需要异步的下发+接受任务, 必须打开
44 | ENABLED: true
45 | SCHEMA: "amqp"
46 | HOST: "127.0.0.1"
47 | PORT: 5672
48 | USERNAME: "admin"
49 | PASSWORD: "123456"
50 | VHOST: "codo"
51 |
52 | # (推荐配置) REDIS 发布订阅配置
53 | # 用于:
54 | # CDMB 任务同步
55 | # CODO 任务分发
56 | PUBLISH:
57 | # 如果多个 agent-server 实例必须开启
58 | P-ENABLED: true
59 | P-HOST: 127.0.0.1
60 | P-PORT: 6379
61 | P-PASSWORD: ""
62 | P-DB: 2
--------------------------------------------------------------------------------
/img/28fb5b67-0168-4da3-9af3-90435250fbf0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/28fb5b67-0168-4da3-9af3-90435250fbf0.png
--------------------------------------------------------------------------------
/img/2d-e4fd-4933-ac83-a82a8ac94ad5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/2d-e4fd-4933-ac83-a82a8ac94ad5.png
--------------------------------------------------------------------------------
/img/4f187f6b-7916-4177-8ec2-af89af2fabfd.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/4f187f6b-7916-4177-8ec2-af89af2fabfd.jpeg
--------------------------------------------------------------------------------
/img/4frd-e4fd-4933-ac83-a82a8a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/4frd-e4fd-4933-ac83-a82a8a.png
--------------------------------------------------------------------------------
/img/5098e991-311c-4b98-8813-6a372eaf40ec.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/5098e991-311c-4b98-8813-6a372eaf40ec.png
--------------------------------------------------------------------------------
/img/5cc70f6e-29af-419c-a5a9-fe1d42e73f21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/5cc70f6e-29af-419c-a5a9-fe1d42e73f21.png
--------------------------------------------------------------------------------
/img/70f6e-29af-419c-a5a9-fe1d42e73.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/70f6e-29af-419c-a5a9-fe1d42e73.png
--------------------------------------------------------------------------------
/img/a9e48c16-44cd-4e7f-81b4-05a01b709e05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/a9e48c16-44cd-4e7f-81b4-05a01b709e05.png
--------------------------------------------------------------------------------
/img/afb80896-0b83-4b90-b19a-ff8be025296d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/afb80896-0b83-4b90-b19a-ff8be025296d.png
--------------------------------------------------------------------------------
/img/b37311eb-bbf1-4b5c-88a4-811d8270cd72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/b37311eb-bbf1-4b5c-88a4-811d8270cd72.png
--------------------------------------------------------------------------------
/img/dd219597-c5ed-4477-997f-554fcd08e016.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/dd219597-c5ed-4477-997f-554fcd08e016.png
--------------------------------------------------------------------------------
/img/de211ee2-4ba1-42b2-96c7-894a0e7dc7aa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/de211ee2-4ba1-42b2-96c7-894a0e7dc7aa.png
--------------------------------------------------------------------------------
/img/de921cf5-3887-4674-bb74-ed9d94adafea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/de921cf5-3887-4674-bb74-ed9d94adafea.png
--------------------------------------------------------------------------------
/img/df95085a-6ab4-47df-a3d3-3b145de00698.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/df95085a-6ab4-47df-a3d3-3b145de00698.png
--------------------------------------------------------------------------------
/img/e128a45d-e4fd-4933-ac83-a82a8ac94ad5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendevops-cn/codo-agent-server/e7fc99eebf707e5ec2b306243d6215881c672ba5/img/e128a45d-e4fd-4933-ac83-a82a8ac94ad5.png
--------------------------------------------------------------------------------
/安装文档.md:
--------------------------------------------------------------------------------
1 | # Agent安装说明
2 | ## 安装脚本及命令
3 | - 建立codoagent目录(位置随意)
4 |
5 | ```bash
6 | cd /d
7 | mkdir codoagent
8 | cd codoagent
9 | ```
10 | - 在目录下执行以下命令,初始化安装脚本
11 |
12 | ```bash
13 | curl -O https://ops-public.huanle.com/agent/agent.py
14 | sudo python3 agent.py
15 | ```
16 |
17 | - 编辑 `agent_config.json `
18 |
19 | ```bash
20 | agent_id: 是机器在codo和行云上使用的名字,全局唯一。
21 | biz_id: 在这里可以找到
22 | ```
23 |
24 | 
25 |
26 | ```bash
27 | # agent_config.json 字段解释
28 | {
29 | # id 必填, 不可重复
30 | "agent_id": "None",
31 | # 业务id 必填, 填自己的业务id
32 | "biz_id": "None",
33 | # 别名 可选, 在行云上展示的中文样式, 默认 = id
34 | "alias": "None",
35 | # 服务注册地址 可选, 默认为公司内codo
36 | "agent_server": "wss://codo-proxy-intra.xxxx.com:20801",
37 | # ssh登录, 如果需要本地ssh启动agent,则需要填入用户名
38 | "ssh_username": "None",
39 | # 上面的用户名对应的密码
40 | "ssh_password": "None",
41 | # 服务名称, 可选, 默认为codo-agent-{id}
42 | "serviced_name": "None",
43 | # 安装版本, 默认为最新线上稳定版本, 如果需要指定版本可填入如: v1.3.26
44 | "preview_version": "None",
45 | # 杀死子进程, 将这个设置为 "true", 会开启一个特性,终止进程时可以杀死所有子进程
46 | "force_kill_sub_proc": "None"
47 | }
48 | ```
49 |
50 | - 安装agent
51 |
52 | windows需要管理员(mac和linux需要加sudo)运行以下命令,如果显示以下字样则说明安装成功
53 |
54 | ```bash
55 | sudo python3 agent.py install
56 | ```
57 |
58 | 
59 |
60 | - 其他agent维护命令
61 |
62 | 
63 |
64 | #### Windows问题排查
65 |
66 | 检查进程是否开启: `tasklist | findstr "codo"`
67 |
68 | #### 守护进程排查思路
69 |
70 | - windows的守护进程是基于windows服务功能的。
71 | - 可以通过 win+r 输入 services.msc 打开服务
72 | - 调整服务设置
73 | win+r 输入 services.msc 打开服务,找到注册的codo-agent服务, 确认agent运行状态
74 | 
75 | 
76 | - 一个启动失败的排查思路,将这一串复制到命令行里执行,观察为什么执行不成功
77 | 
78 | - 检查进程是否启动 `tasklist | findstr "codo"`
79 | - 杀死进程 `taskkill /F /PID 24432`
80 |
81 | #### windows开启ssh server
82 |
83 | - 在命令行输入这个命令ssh连接本机,如果成功执行就说明已经安装好了,可以跳过这一步
84 |
85 | ```bash
86 | ssh rowork@127.0.0.1 -p 22
87 | ```
88 |
89 | - 先打开设置里的开发者选项
90 | 
91 | - 开始 → 设置 → 应用 →可选功能,确保已经装好OpenSSH服务器,一般来说默认安装OpenSSH客户端。如果没有安装,则需要在“添加功能”里搜到并安装。
92 | 
93 | - win+r 输入 services.msc 打开windows服务列表,确认OpenSSH SSH Server服务打开,并调整服务设置
94 | 
95 | 
96 | - 下述命令可以执行无问题后,进行下一步
97 |
98 | ```bash
99 | ssh {username}@127.0.0.1 -p 22
100 | ```
101 |
102 | #### windows安装python
103 |
104 | - 下载地址,最好版本高于3.7
105 | 此处应有一个压缩包
106 | - 可以安装到这个目录,便于后续维护,并勾选添加PATH
107 | 
108 | - 如果你想同时拥有python或者python3命令, 可以将python.exe复制一份为python3.exe
109 | - 如果你不想影响原有的python命令(比如python2),可以将python.exe重命名为python3.exe
110 | 
111 |
112 | ## Mac问题排查
113 |
114 | 检查是否成功启动 ps -ef | grep codo
115 | macos开启ssh server
116 | - 在命令行输入这个命令ssh连接本机,如果能用就说明已经安装好了。(jenkins是机器的用户名,根据实际情况替换)
117 |
118 | ```bash
119 | ssh jenkins@127.0.0.1 -p 22
120 | ```
121 |
122 | - 如果没开ssh,开启本机ssh需要在 设置 - 共享 里打开以下选项:
123 | 
124 |
125 | #### macos处理环境变量问题
126 |
127 | mac的默认ssh不加载默认环境变量,为了保证PATH和实际环境一致给 `.bashrc` 文件加上两行
128 |
129 | ```bash
130 | source /etc/profile
131 | source ~/.bash_profile
132 | ```
133 |
134 | #### 守护进程排查思路
135 |
136 | macos的守护进程是基于 launchctl 的。
137 |
138 | - 检查是否成功启动 `ps -ef | grep codo`
139 | - 访问 /Library/LaunchDaemons/{服务名}.plist 可以看到 launchctl 的注册详情
140 | - 查看对应的log文件检查启动为什么失败
141 | 
142 | - 本地debug启动服务: launchctl debug system/codo-agent --stdout --stderr
143 |
144 | #### Linux问题排查
145 |
146 | 检查是否成功启动 ps -ef | grep codo
147 |
148 | #### 守护进程排查思路
149 |
150 | linux的守护进程是基于 systemctl的
151 | 服务注册文件位于: /etc/systemd/system/
152 | 查看当前服务状态: systemctl status codo-agent
153 |
154 | #### selinux限制
155 |
156 | sestatus
157 | ausearch -m avc -ts recent | audit2why
--------------------------------------------------------------------------------
/更新日志.md:
--------------------------------------------------------------------------------
1 | v1.3.26 (2024-04-25)
2 | Feat
3 | - share_file: 分享文件修复限速问题 (6650f05)
4 |
5 | v1.3.25 (2024-04-08)
6 | Feat
7 | - exec: 强杀优化支持三端 (496bee3)
8 |
9 | v1.3.24 (2024-04-08)
10 | Fix
11 | - exec: 修复了 cancel 时, 没开强杀取消失败的 bug (95ff557)
12 |
13 | v1.3.23 (2024-03-19)
14 | Feat
15 | - metrics: 心跳改造成应用层心跳 && 添加 metrics (60476f5)
16 |
17 | v1.3.22 (2024-03-05)
18 | Feat
19 | - meta: 元数据添加 mac地址 和 磁盘序列号 (9b49382)
20 |
21 | v1.3.21 (2024-02-28)
22 | Feat
23 | - conf: WorkDIR 取值调整 (462fce1)
24 | - host: 如果参数前缀是 codo ,依然会加前缀,统一一下,方便后续维护 (87dbca5)
25 | - makefile: 打包脚本去除 CGO 依赖 (7ccd879)
26 | - makefile: 去除动态链接库 (1af247e)
27 |
28 | v1.3.20 (2023-12-22)
29 | Feat
30 | - agent: 去除管道关闭延迟,这个修改可能导致孙子进程结束日志不被捕获,但是降低了大部份场景的时延 (f3a40dc)
31 | - agent: 文件同步,支持严谨模式(2) 强制模式(1) & 限速器优化 (6f06f6d)
32 | - agent: 添加 wait delay 参数 (0582096)
33 | - agent: 杀死进程树功能改成实验性特性,默认不主动强杀进程树 (7267287)
34 | - agent: windows agent 支持退出时进程树强杀 (64579fa)
35 | - agent: 退出服务优化 (4cc48d5)
36 | - agent: 退出服务优化 (df07a48)
37 | - agent: 强杀进程优化 (37e8ce0)
38 | - app: 执行任务 ctx err 展示调整 (93625a8)
39 | - app: codo 日志 在报错时 超过最大行数时展示额外至多 200 行 (eef14f7)
40 | - archive: 打包时 转译文件 (c5a8c78)
41 | - exec: 支持 linux 强杀进程 (919f735)
42 | - exec: 支持 linux 强杀进程 (b7e3a74)
43 | - exec: 执行 命令输出 info 日志,标识进程树 (e027733)
44 | - exec: 执行 命令优化 (ab27252)
45 | - exec: 执行 命令优化 (e6c5712)
46 | - exec: 杀进程时输出杀掉的 pid (a145922)
47 | - exec: 忽略 ErrWaitDelay 错误 (c07c99d)
48 | - host: EOF 逻辑调整 (dbad3c4)
49 | - host: SOF 前后空格去除 (adf481c)
50 | Fix
51 | - archive: 修复了 解压文件时 前缀没传的 bug (ce023d9)
52 | - log: 修复了 head 方式日志拉取,单行日志过大时拉取异常的 bug (c1c4f9a)
53 | - log: 修复了增量日志拉取异常的 bug (5045864)
54 |
55 |
56 | v1.3.19 (2023-12-18)
57 | Feat
58 | - app: codo 日志 在报错时 超过最大行数时展示额外至多 200 行 (eef14f7)
59 |
60 | v1.3.18 (2023-12-15)
61 | Feat
62 | - app: 执行任务 ctx err 展示调整 (93625a8)
63 |
64 | v1.3.17 (2023-12-12)
65 | Feat
66 | - exec: 忽略 ErrWaitDelay 错误 (c07c99d)
67 |
68 | v1.3.16 (2023-11-29)
69 | Feat
70 | - agent: 退出服务优化 (4cc48d5)
71 |
72 | v1.3.15 (2023-11-17)
73 | Feat
74 | - agent: 退出服务优化 (df07a48)
75 |
76 | v1.3.14 (2023-11-17)
77 | Feat
78 | - agent: 强杀进程优化 (37e8ce0)
79 | - agent: 添加 wait delay 参数 (0582096)
80 |
81 | v1.3.13 (2023-11-17)
82 | Feat
83 | - agent: 杀死进程树功能改成实验性特性,默认不主动强杀进程树 (7267287)
84 |
85 | v1.3.12 (2023-11-14)
86 | Feat
87 | - agent: 去除管道关闭延迟,这个修改可能导致孙子进程结束日志不被捕获,但是降低了大部份场景的时延 (f3a40dc)
88 | - archive: 打包时 转译文件 (c5a8c78)
89 | Fix
90 | - archive: 修复了 解压文件时 前缀没传的 bug (ce023d9)
91 |
92 | v1.3.11 (2023-11-01)
93 | Feat
94 | - exec: 执行 命令输出 info 日志,标识进程树 (e027733)
95 |
96 | v1.3.10 (2023-10-28)
97 | Feat
98 | - agent: windows agent 支持退出时进程树强杀 (64579fa)
99 | - agent: 文件同步,支持严谨模式(2) 强制模式(1) & 限速器优化 (6f06f6d)
100 | - exec: 执行 命令优化 (ab27252)
101 | - exec: 执行 命令优化 (e6c5712)
102 | - exec: 杀进程时输出杀掉的 pid (a145922)
103 | - host: SOF 前后空格去除 (adf481c)
104 | - host: EOF 逻辑调整 (dbad3c4)
105 | - main: 添加 GC 并且 SOF 逻辑调整 (4a76f9a)
106 | Fix
107 | - log: 修复了 head 方式日志拉取,单行日志过大时拉取异常的 bug (c1c4f9a)
108 | - log: 修复了增量日志拉取异常的 bug (5045864)
109 |
110 | v1.3.9 (2023-10-26)
111 | Fix
112 | - log: 修复了 head 方式日志拉取,单行日志过大时拉取异常的 bug (c1c4f9a)
113 |
114 | v1.3.8 (2023-10-26)
115 | Fix
116 | - log: 修复了增量日志拉取异常的 bug (5045864)
117 |
118 | v1.3.7 (2023-10-25)
119 | Feat
120 | - exec: 杀进程时输出杀掉的 pid (a145922)
121 |
122 | v1.3.6 (2023-10-23)
123 | Feat
124 | - agent: windows agent 支持退出时进程树强杀 (64579fa)
125 |
126 | v1.3.5 (2023-10-17)
127 | Feat
128 | - agent: 文件同步,支持严谨模式(2) 强制模式(1) & 限速器优化 (6f06f6d)
129 |
130 | v1.3.4 (2023-10-16)
131 | Feat
132 | - host: SOF 前后空格去除 (adf481c)
133 |
134 | v1.3.3 (2023-10-12)
135 | v1.3.2 (2023-10-12)
136 | v1.3.1 (2023-10-08)
137 | Feat
138 | - host: agent 执行任务 获取 SOF ,并附加到成功输出流里 (7128521)
139 | - sync_files: GC 逻辑调整,删除一天前的数据 (8c5e124)
140 |
141 | v1.3.0 (2023-10-07)
142 | Feat
143 | - app: 添加检查文件是否存在的功能 CheckFiles (3e94a2d)
144 | - app: 添加文件压缩 & 文件共享功能 (8dd16e9)
145 | - app: 添加 helper 文件集成通用功能 (b911e9e)
146 | - bak: 内容统一使用过 GBK2UTF8 转化,如果是 UTF8 则取消转化 (7f20707)
147 | - conf: 添加别名配置 & 平台参数 (08e361b)
148 | - exec: exec 支持指定文件夹作为工作目录 添加 ScriptPathAsWD、WorkDIR 配置参数 (2561fea)
149 | - exec: windows exec 优化 (9eb5477)
150 | - log: 日志查询字符集转换 调整到日志录入时就转换 (eba971f)
151 | - main: 相同工作目录只能启动一个 codo agent (dd1fb18)
152 | - pkg: 添加压缩功能、错误集合功能,限速功能 (a1ed965)
153 | - task: task 刷新逻辑优化当空闲的时候就触发一次刷新 (df68eb4)
154 | Fix
155 | - share_file: 修复了同步文件时 同步异常的bug (941127d)
156 |
157 | v1.2.9 (2023-08-15)
158 | Feat
159 | - host: exec 时支持使用 ssh 模拟登陆执行命令 (16adadc)
160 | Fix
161 | - log: 修复了获取日志时,尾部读取重复日志的 bug & charset判断异常的 bug (25780bb)
162 |
163 | v1.2.8 (2023-08-09)
164 | Feat
165 | - host: codo参数环境变量修改成 CODO_ & codo_ 并且兼容老版本 & 获取日志命令不再创建日志文件 (7b5ae2d)
166 |
167 | v1.2.7 (2023-07-31)
168 | Feat
169 | - log: 日志尾部读取优化 800% (e237dfe)
170 |
171 | v1.2.6 (2023-07-26)
172 | Fix
173 | - charset: 修复了字符集误判 GBK 编码的 bug (3a7bfa7)
174 |
175 | v1.2.5 (2023-07-26)
176 | Feat
177 | - conf: conf 初始化时 将 RootPath 转化成绝对路径 (420c431)
178 |
179 | v1.2.4 (2023-07-20)
180 | Feat
181 | - cmd: log 支持读取 GBK 日志 (8aa9548)
182 | - cmd: 优化 删除密钥文件夹逻辑 (1f06490)
183 | - cmd: 优化 exec 错误信息,修复了日志读取异常的 bug (ab89e63)
184 |
185 | v1.2.3 (2023-07-19)
186 | Feat
187 | - cmd: 文件名调整为 agentid crc32 (453eb2b)
188 |
189 | v1.2.2 (2023-07-19)
190 |
191 | v1.2.14 (2023-08-28)
192 | Feat
193 | - task: task 刷新逻辑优化当空闲的时候就触发一次刷新 (df68eb4)
194 |
195 | v1.2.13 (2023-08-25)
196 | Feat
197 | - conf: 添加别名配置 & 平台参数 (08e361b)
198 |
199 | v1.2.12 (2023-08-24)
200 | Feat
201 | - bak: 内容统一使用过 GBK2UTF8 转化,如果是 UTF8 则取消转化 (7f20707)
202 |
203 | v1.2.11 (2023-08-21)
204 | Feat
205 | - exec: exec 支持指定文件夹作为工作目录 添加 ScriptPathAsWD、WorkDIR 配置参数 (2561fea)
206 | - main: 相同工作目录只能启动一个 codo agent (dd1fb18)
207 |
208 | v1.2.10 (2023-08-17)
209 | Feat
210 | - cmd: log 支持读取 GBK 日志 (8aa9548)
211 | - cmd: 优化 删除密钥文件夹逻辑 (1f06490)
212 | - cmd: 优化 exec 错误信息,修复了日志读取异常的 bug (ab89e63)
213 | - cmd: 文件名调整为 agentid crc32 (453eb2b)
214 | - cmd: log cmd 支持从尾部输出日志 (8d16b4d)
215 | - conf: conf 初始化时 将 RootPath 转化成绝对路径 (420c431)
216 | - exec: windows exec 优化 (9eb5477)
217 | - host: exec 时支持使用 ssh 模拟登陆执行命令 (16adadc)
218 | - host: codo参数环境变量修改成 CODO_ & codo_ 并且兼容老版本 & 获取日志命令不再创建日志文件 (7b5ae2d)
219 | - log: 日志查询字符集转换 调整到日志录入时就转换 (eba971f)
220 | - log: 日志尾部读取优化 800% (e237dfe)
221 | Fix
222 | - charset: 修复了字符集误判 GBK 编码的 bug (3a7bfa7)
223 | - log: 修复了获取日志时,尾部读取重复日志的 bug & charset判断异常的 bug (25780bb)
224 |
225 | v1.2.1 (2023-07-18)
226 | Feat
227 | - cmd: codo install 添加 work dir (325fb53)
228 | - cmd: codo service kill 时 不停止服务 (34eb808)
229 | - cmd: codo service install 时,支持 work-dir 参数指定运行时的工作目录 (0151b4c)
230 |
231 | v1.2.0 (2023-07-13)
232 | Feat
233 | - app: agent 执行将脚本参数作为环境变量注入 (bdc2154)
234 | - cmd: codo 支持命令级别的守护进程方式运行 & 命令目录架构优化 (8867794)
235 | - exec: exec stderr 包装 STDERR 关键字 (cac7099)
236 | - host: 密钥 环境变量 维持 大写开头 , 其余环境变量维持小写 (f727db6)
237 | Fix
238 | - exec: 修复了 exec stderr 返回字符数异常的 bug (94bb35d)
239 | - host: 修复了 windows 下 codo 前缀 异常的 bug (e1307bc)
240 | - host: 修复了 密钥 环境变量前缀 异常的 bug (0d6ba1c)
241 |
242 | v1.1.9 (2023-07-06)
243 | Feat
244 | - bak: 文件日志备份添加时间前缀,密钥清理时清理文件夹 (1e07408)
245 |
246 | v1.1.8 (2023-07-03)
247 | Feat
248 | - heartbeat: 心跳附带 biz-id 信息,main函数支持从命令行中接收 group_name biz_id mac_exec_cmd 配置 (4779a66)
249 |
250 | v1.1.7 (2023-06-26)
251 | Fix
252 | - secret: 修复了密钥分割之后为空时替换异常的bug (4b7e4cb)
253 |
254 | v1.1.6 (2023-06-21)
255 | Feat
256 | - app: 一些优化 - 心跳信息发送支持携带当前状态 - 获取任务为空时进行并发判断,只有一个会正常返回 - 命令执行最大任务数设置 (73feac9)
257 |
258 | v1.1.5 (2023-06-15)
259 | Feat
260 | - Makefile: Makefile 支持 mac 包 win 包 , 并且自动更新逻辑进行判断 (6f5a209)
261 | - secret: secret value \n (227f867)
262 |
263 | v1.1.4 (2023-06-15)
264 | Feat
265 | - update: agent auto update (1aba8e5)
266 |
267 | v1.1.3 (2023-06-12)
268 | Feat
269 | - update: agent auto update (751372d)
270 | - update: agent auto update (d35c931)
271 |
272 | v1.1.2 (2023-06-09)
273 |
274 | v1.1.14 (2023-07-13)
275 | Feat
276 | - host: 密钥 环境变量 维持 大写开头 , 其余环境变量维持小写 (f727db6)
277 |
278 | v1.1.13 (2023-07-12)
279 | Fix
280 | - host: 修复了 windows 下 codo 前缀 异常的 bug (e1307bc)
281 |
282 | v1.1.12 (2023-07-12)
283 | Fix
284 | - host: 修复了 密钥 环境变量前缀 异常的 bug (0d6ba1c)
285 |
286 | v1.1.11 (2023-07-12)
287 | Fix
288 | - exec: 修复了 exec stderr 返回字符数异常的 bug (94bb35d)
289 |
290 | v1.1.10 (2023-07-10)
291 | Feat
292 | - Makefile: Makefile 支持 mac 包 win 包 , 并且自动更新逻辑进行判断 (6f5a209)
293 | - app: agent 执行将脚本参数作为环境变量注入 (bdc2154)
294 | - app: 一些优化 - 心跳信息发送支持携带当前状态 - 获取任务为空时进行并发判断,只有一个会正常返回 - 命令执行最大任务数设置 (73feac9)
295 | - app: 日志信息优化 & 密钥脱敏优化 (12a95b5)
296 | - bak: 文件日志备份添加时间前缀,密钥清理时清理文件夹 (1e07408)
297 | - exec: exec stderr 包装 STDERR 关键字 (cac7099)
298 | - heartbeat: 心跳附带 biz-id 信息,main函数支持从命令行中接收 group_name biz_id mac_exec_cmd 配置 (4779a66)
299 | - makefile: Makefile 添加 windows 编译 (a8be6aa)
300 | - secret: secret value \n (227f867)
301 | - update: agent auto update (1aba8e5)
302 | - update: agent auto update (751372d)
303 | - update: agent auto update (d35c931)
304 | Fix
305 | - secret: 修复了密钥分割之后为空时替换异常的bug (4b7e4cb)
306 |
307 | v1.1.1 (2023-06-08)
308 | Feat
309 | - log: ping pong 日志 改成 INFO (2473743)
310 | - makefile: makefile 优化 (2349b22)
311 |
312 | v1.1.0 (2023-06-08)
313 | Feat
314 | - app: 密钥脱敏 (057d1ca)
315 | - app: CODO 环境变量 执行时添加 CODO 前缀 (72830f2)
316 | - app: 任务日志文件记录全量日志,保留原先的部分日志功能 (165f839)
317 | - cmd: cmd 支持 日志命令取执行日志 (6f756da)
318 | - crypto: 支持加密内容 (9527ae1)
319 | - crypto: 支持加密内容 (127687c)
320 | - host: 密钥文件夹创建 (52ded65)
321 | - host: 密钥文件删除功能 (5cac126)
322 | - lint: lint 修改 (485aae0)
323 | - log: 日志等级改成 默认 INFO (017cafa)
324 | Fix
325 | - app: 修复了执行时空指针异常的 bug (4ecd556)
326 |
327 |
328 |
--------------------------------------------------------------------------------