Commit Graph

34 Commits

Author SHA1 Message Date
stonezdj(Daojun Zhang) 654aa8edcf
Add generate SBOM feature (#20251)
* Add SBOM scan feature

  Add scan handler for sbom
  Delete previous sbom accessory before the job service

Signed-off-by: stonezdj <daojunz@vmware.com>

* fix issue

Signed-off-by: stonezdj <stone.zhang@broadcom.com>

---------

Signed-off-by: stonezdj <daojunz@vmware.com>
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-16 13:34:19 +00:00
stonezdj(Daojun Zhang) be648ea47f
Refactor scan job service make it easy to add new scan type (#20177)
Signed-off-by: stonezdj <daojunz@vmware.com>
Signed-off-by: stonezdj(Daojun Zhang) <stonezdj@gmail.com>
Co-authored-by: stonezdj <daojunz@vmware.com>
2024-04-09 16:05:30 +08:00
Chlins Zhang c7e25295fe
fix: support customize cache db for business (#19182)
Support to configure the customized redis db for cache layer and other
misc business for core, by default the behavior is same with
previous(stored in db 0).

Signed-off-by: chlins <chenyuzh@vmware.com>
2023-08-18 11:04:16 +08:00
Wang Yan ae33dbd801
fix accessory import issue (#19053)
fixes #19041

The issuse was introduced by https://github.com/goharbor/harbor/pull/17087.
To move the import to main since the anonymous imports only allowed at main in go-cilint.

Fixes it:
To add the anonymous imports at the jobservice main since the gc job needs to remove accessory when to delete an artifact

Signed-off-by: wang yan <wangyan@vmware.com>
2023-07-30 22:36:03 +08:00
Chenyu Zhang 1a1ce634cc
Fix the process of cache layer (#17010)
fix: fix cache layer issues (#16995,#16997,#16996,#17038)

1. Load config and initialize cache layer in jobservice(for GC)
2. Cache artifact by digest the key should contains repository name
3. Repository cache cleanup error when update
4. Skip save cache when request ctx in transaction

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-07-06 16:11:53 +08:00
Shengwen YU b43ba15f40
fix: golangci-lint errcheck (#16920)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-07 17:00:36 +08:00
stonezdj 5618f6d211 The DB config manager is not init on jobservice to call config.WithNotary
Make func defaultMgr() public
  Set DefaultCfgManager to RestCfgManager and Load it in the jobservice main
  config.WithNotary call DefaultMgr(), it wil get the RestCfgManager
  Fixes #16418

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-03-03 14:42:56 +08:00
Qian Deng 31707dbf25 Using harbor lib config
using config manager to get env configs

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng bad913cf6d Refactor trace code
* use lib trace helper function
* add gracefull shutdown
* Add commens for new added exposed function
* Add licence on top of new created files
* Update trace library
* Update configs
* Add attribute and namespance in config

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng 6fec5b2873 Add trace to jobservice
* Add trace init in main
* Add env template
* Add trace for router

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
stonezdj 107e468b60 Refactor configure api to new programming model
Changes include:
1. Move core/config to controller/config
2. Change the job_service and gcreadonly to depends on lib/config instead of core/config
3. Move the config related dao, manager and driver to pkg/config
4. Adjust the invocation of the config API, most of then should provide a context parameter, when accessing system config, you can call it with background context, when accessing user config, the context should provide orm.Context

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-04-09 08:10:11 +08:00
Wenkai Yin 1adf5c976e Create retention client with the configurations got from jobservice config
As the retention client is only used in job which running in jobservice, the configurations that needed to init the client should be read from jobservice

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-07-24 13:10:10 +08:00
Steven Zou 2562146faf adjust the order of robot test case of API_DB
Signed-off-by: Steven Zou <szou@vmware.com>
2019-05-07 16:13:31 +08:00
Steven Zou f2870272ce add get jobs API to provide powerful job stats management
Signed-off-by: Steven Zou <szou@vmware.com>
2019-04-28 22:36:13 +08:00
Steven Zou 9bcbe2907b fix go vet issues in the code
Signed-off-by: Steven Zou <szou@vmware.com>
2019-04-24 07:31:37 +08:00
Steven Zou 6f8a80d21c refine the hook event and status update retry approach
Signed-off-by: Steven Zou <szou@vmware.com>
2019-04-20 15:00:32 +08:00
Steven Zou f8feaa192e add get scheduled and periodic executions APIs
Signed-off-by: Steven Zou <szou@vmware.com>
2019-04-19 13:54:23 +08:00
Steven Zou 1f481e492c Refactor job servcie primary logic to fix related bugs
Signed-off-by: Steven Zou <szou@vmware.com>
2019-04-18 16:02:49 +08:00
stonezdj 1ae5126bb4 Refactor adminserver stage 3: replace config api and change ut settings
Signed-off-by: stonezdj <stonezdj@gmail.com>
2019-02-18 14:06:19 +08:00
Steven Zou 01bb7f4abb Uncomment the harbor configuration injection code block
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-09 10:19:14 +08:00
Steven Zou 7b106d06c5 Build logger framework to support configurable loggers/sweepers/getters
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-06 09:31:31 +08:00
Steven Zou 7ca2e9df81 Enhance job service to support multiple executions rectording
- print more logs
- add execution records for periodic job
- add launch job func in job context to launch sub job
- replace copyright header with new version

Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-19 11:02:09 +08:00
陈德 0582db9a82 Apply consistent format for comments
Signed-off-by: 陈德 <chende@caicloud.io>
2018-09-05 16:16:31 +08:00
Daniel Jiang dcf4e2ee78 Update import path in go code
vmware -> goharbor

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-08-23 17:50:53 +08:00
Steven Zou f7bc467c99 Return none zero code when job service exit with error
replace fmt.Println/logger.Errorf with logger.Fatal(f)
2018-05-10 14:44:04 +08:00
Steven Zou 013028ef4a Replace old job service package with V2 (rename packages) 2018-03-30 11:22:29 +08:00
Steven Zou bfbb949034 Use the new job service(v2) to replace the old one 2018-03-29 23:30:03 +08:00
Tan Jiang 2ffcf10eaa restart scan jobs when jobservice is started 2017-08-16 17:24:41 +08:00
Tan Jiang 97b334c3c0 fix #1953 2017-07-25 21:12:03 +08:00
Daniel Jiang 1c441b17be refactor job service (#2348) 2017-05-22 22:33:20 -07:00
wy65701436 53f7cfb967 replace go header 2017-04-13 03:54:58 -07:00
Wenkai Yin f1f78a5649 update 2017-01-19 17:56:08 +08:00
Wenkai Yin b62a958250 configure harbor 2017-01-12 17:15:32 +08:00
yhua 311cf8da07 change code 20161019 2016-10-21 18:39:10 +08:00