Wenkai Yin
1d16e18dff
Remove "ng" from source code
...
Remove "ng" from source code
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-04-12 22:42:27 +08:00
慕薇疯魔
a555b09df0
1. Implement native docker registry adapter.
...
2. register the native adapter.
Signed-off-by: 慕薇疯魔 <kfanjian@gmail.com>
2019-04-12 21:08:23 +08:00
cd1989
b876a576a6
Implement dockerhub adapter
...
Signed-off-by: cd1989 <chende@caicloud.io>
2019-04-12 17:31:32 +08:00
Wenkai Yin
b73acde051
Support the migration for scheduled replication rule from previous version of Harbor
...
Support the migration for scheduled replication rule from previous version of Harbor
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-04-11 13:14:32 +08:00
Wenkai Yin
4f8e283e8e
Add event based trigger and scheduled trigger
...
This commit implements the event based trigger and scheduled trigger in replilcation
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-03-29 13:48:34 +08:00
Wenkai Yin
49cf50adb1
Merge remote-tracking branch 'upstream/master' into 190324_sync
...
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-03-22 15:55:52 +08:00
Wenkai Yin
258b22a9a5
Fix bug in replication
...
This commit fixes bugs found in the implement of replciation NG
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-03-10 20:57:59 +08:00
Wenkai Yin
772367498f
Merge remote-tracking branch 'upstream/master' into 190311_sync
2019-03-11 20:34:49 +08:00
Qian Deng
5f80fe7b8a
Refacotr the prepare script base on the proposal https://github.com/goharbor/community/pull/22
...
Signed-off-by: Qian Deng <dengq@vmware.com>
2019-03-08 16:46:13 +08:00
He Weiwei
053a18a490
Skip transfer blob for foreign layers
...
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-02-27 16:14:17 +08:00
Wenkai Yin
95888b3dc2
Merge branch 'replication_ng' into 190130_transfer_repo
2019-02-27 11:00:42 +08:00
stonezdj(Daojun Zhang)
4cb49e5388
Merge pull request #6963 from stonezdj/remove_container
...
Remove everything of adminserver container
2019-02-22 18:27:43 +08:00
stonezdj
0cba36d79f
Remove everything of adminserver
...
Signed-off-by: stonezdj <stonezdj@gmail.com>
2019-02-22 16:34:39 +08:00
Nguyen Quang Huy
eda6c47b3e
add signoff for DCO gate ( #6981 )
...
Some variable name, function name is colliding with builtin function.
Signed-off-by: Nguyen Quang Huy <huynq0911@gmail.com>
2019-02-22 15:00:18 +08:00
Wenkai Yin
0c0c833dda
Merge remote-tracking branch 'upstream/master' into 190220_sync
2019-02-20 17:21:38 +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
Wenkai Yin
f0f2e77fb4
Implement the repository transfer
...
This commit implements the Transfer interface for resource repository
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-02-15 17:49:35 +08:00
Wenkai Yin
759cb5467b
Refine the replication job
...
1. Refine the replication job
2. Define the Transfer interface
3. Define the common models
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2019-01-29 15:48:02 +08:00
Wenkai Yin
5388eb4db6
Read ssl mode param from the adminserver to init the connection with database ( #6504 )
...
This commit adds the ssl mode as a param when establishing the connection with database
Signed-off-by: Wenkai Yin <yinw@vmware.com>
2018-12-11 13:58:37 +08:00
peimingming
585d7b2b01
Add unit test for JobService Logger
...
Signed-off-by: peimingming <peimingming@corp.netease.com>
2018-12-03 16:20:03 +08:00
Steven Zou
84d864607c
Add UT cases for new added code
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-30 16:08:15 +08:00
Steven Zou
ccd486a0ad
Support unique job constraints (both unique queue and running jobs)
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-30 14:14:21 +08:00
peimingming
238dbc0347
Add UT and review comments and issue fix ( #6144 )
...
Signed-off-by: peimingming <peimingming@corp.netease.com>
2018-11-28 17:43:14 +08:00
peimingming
c67fdc40f5
Support store job log in DB ( #6144 )
...
Signed-off-by: peimingming <peimingming@corp.netease.com>
2018-11-28 15:09:29 +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
8f0e8d083a
Fix typo in the README doc of jobservice
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-08 18:24:41 +08:00
Steven Zou
093bf9fc8a
Update the job service config yaml in the installation template
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-08 10:40:39 +08:00
Steven Zou
e6d4c024ee
Update README of job service to reflect latest updates
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-08 10:35:12 +08:00
Steven Zou
e9194ca107
Add/update unit test cases for the new implemented job logger framework
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-11-06 14:43:06 +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
300977d539
Use separate redis conn for the lock mechanism in the periodic enqueuer
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-31 15:19:11 +08:00
Steven Zou
58eefb9c17
Add TestOnBorrow check func of redis pool to verify the getting conn
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-31 13:30:29 +08:00
Steven Zou
b48748492e
Fix the issue of stopping periodic job ( #6174 )
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-31 11:43:46 +08:00
Steven Zou
8341aa14b0
Support health check free call in job service
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-30 17:35:07 +08:00
Wenkai Yin
af17c2c3fd
Merge pull request #6154 from wy65701436/fix-gc-redis
...
Fix gc jobs issues
2018-10-29 16:29:57 +08:00
Steven Zou
dde6c39e80
Merge pull request #6169 from steven-zou/fix_issue_of_periodic_conflicts
...
Return 409 conflict error in liue of 200 with ID of existing one
2018-10-29 16:18:40 +08:00
Steven Zou
408b751ae6
Return 409 conflict error in liue of 200 with ID of existing one when submmiting periodic job
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-29 15:40:31 +08:00
wang yan
903d3906ab
Fix per comments by wk
...
Signed-off-by: wang yan <wangyan@vmware.com>
2018-10-29 15:29:14 +08:00
Steven Zou
d32e51052e
Fix the issue of duplicated periodic job scheduling
...
Signed-off-by: Steven Zou <szou@vmware.com>
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-29 14:52:45 +08:00
wang yan
566169f59a
Fix gc jobs issues.
...
This commit is to fix two problems in the gc job,
1, in order to support redis cluseter, gc job should delete the keys only
for docker reigstry instead of all keys. It because that in the redis cluster,
only db 0 is supported.
2, to restore the real status of read only not just to set it to false.
Signed-off-by: wang yan <wangyan@vmware.com>
2018-10-26 18:37:20 +08:00
Steven Zou
a2f0da0d7d
Fix the web hook mising issue for the periodic job executions
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-26 14:28:04 +08:00
Steven Zou
0c901a475f
Merge pull request #6074 from goharbor/enhance_job_service
...
Enhance job service to support multiple executions recording
2018-10-23 09:50:05 +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
stonezdj
79bac7a64e
Change admin server to core in jobservice
...
Signed-off-by: stonezdj <stonezdj@gmail.com>
2018-10-15 14:56:18 +08:00
Steven Zou
326e0d455a
Log error if failed to create logger for job
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-11 16:29:00 +08:00
Wenkai Yin
b4a9eae8cc
Merge pull request #6009 from reasonerjt/fix-insecure-transport
...
Use secure transport to access HTTP endpoint
2018-10-11 10:23:12 +08:00
Steven Zou
95d48436b8
Add README doc for job service ( #6010 )
...
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-10 19:08:20 +08:00
Daniel Jiang
1188bd89b9
Use secure transport to access HTTP endpoint
...
In various parts of the code, we used insecure transport in http Client
when we assume the endpoint is http. This causes complaints form
security scanner. We should use secure transport in such cases.
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-10-10 17:51:02 +08:00
Daniel Jiang
0699980924
Add Scan All job to job service ( #5934 )
...
This commit adds the job to scan all images on registry.
It also makes necessary change to Secret based security context, to
job service has higher permission to call the API of core service.
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-09-22 13:07:32 +08:00
clouderati
587459df15
Replacing copyright notices with "Copyright Project Harbor Authors".
...
Signed-off-by: clouderati <35942204+clouderati@users.noreply.github.com>
2018-09-19 16:59:36 +00:00
Qian Deng
7873a0312a
Rename harbor-ui to harbor-core
...
1. Update the nginx.conf
2. Update Makefile
3. Update docker-compose
4. Update image name
5. Rename folder ui to core
6. Change the harbor-ui's package name to core
7. Remove unused static file on harbor-core
8. Remove unused code for harbor-portal
Signed-off-by: Qian Deng <dengq@vmware.com>
2018-09-19 16:35:13 +08:00
陈德
0582db9a82
Apply consistent format for comments
...
Signed-off-by: 陈德 <chende@caicloud.io>
2018-09-05 16:16:31 +08:00
Steven Zou
1636b138f2
Return more data of the job when reporting status info via webhook
...
- update the status report func `RedisJobStatsManager.reportStatus`
- update the UT case for the above change
Signed-off-by: Steven Zou <szou@vmware.com>
2018-08-30 14:28:12 +08:00
wang yan
aab761ac8a
Fix gofmt check results
...
Signed-off-by: wang yan <wangyan@vmware.com>
2018-08-29 11:50:00 +08:00
Yan
fca2bb3a6b
Fix misspell checking results ( #5749 )
...
Signed-off-by: wang yan <wangyan@vmware.com>
2018-08-29 10:25:42 +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
Daniel Jiang
65cf02a1d7
Validate job ID when getting job log
...
Add validation to job ID in the API to get job log in job service, to
prevent file path traversal attack.
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-08-15 15:33:13 +08:00
wangyan
29d0d51403
Signed-off-by: wangyan <wangyan@vmware.com>
...
Add clean registry cache to gc job
To workaround the issue: https://github.com/docker/distribution/issues/2094
GC needs to clean cache before to call the docker reigstry api to delete blobs.
Otherwise, the following docker push will not be performed as docker registry
does not clean cache in GC, it thinks the image is still there, and the new
blobs will be uploaded.
2018-08-13 02:58:27 -07:00
wangyan
9a95f14918
Cherry-pick -- Fix security issue found by gas
2018-08-03 01:16:53 -07:00
Wenkai Yin
2a40068d75
Fix cross slot issue of redis
...
This commit upgrdes the github.com/gocraft/work package to 0.5.1 and updates the namespace value
to fix the redis cross slot issue mentioned in #4633
2018-07-27 14:23:39 +08:00
Yan
efdb57548f
add admin job api ( #5344 )
...
It supports Harbor admin to trigger job either manual or
schedule. The job will be populated to job service to execute.
The api includes:
1. POST /api/system/gc
2, GET /api/system/gc/:id
3, GET /api/system/gc/:id/log
4, PUT/GET/POST /api/system/gc/schedule
2018-07-20 19:22:37 +08:00
Yan
9e65499c10
Add garbage collection job implemention, this job could ( #5268 )
...
be triggered by manual and schedule. It calls registrtctl
to do the GC job, and log the output.
2018-07-16 18:08:40 +08:00
Steven Zou
4db708096b
Add retry for getting configs from admin server when doing job conetxt initialization
2018-05-10 15:26:59 +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
Yan
ae257433cc
Fully migrate harbor db to postgresql ( #4689 )
...
* Merge harbor db to postgres
2018-04-27 02:27:12 -07:00
Steven Zou
e1b509e3f3
Fix the issue of intermittent restarting of job service
...
github issue: #4712
ping redis server before pool starting
Let worker pool to restart the message server if message server exits with error (controlled by max retries)
2018-04-25 17:02:16 +08:00
Steven Zou
a17436962f
Return the logger.Interface instead of the pointer of logger to avoid nil checking issue
2018-04-20 14:59:28 +08:00
Steven Zou
ca8d3bdcc9
Merge pull request #4638 from vmware/use_redis_url_addr
...
Use redis URL address to replace host:port when connecting to redis server
2018-04-17 10:12:51 +08:00
Steven Zou
adc2f8f124
Use redis URL address to replace host:port when connecting to redis server
...
replace tcp host:port with
'redis://arbitrary_usrname:password@ipaddress:port/database_index'
update prepare to generate config yaml file of job service based on harbor.cfg
update harbor.cfg default values
2018-04-13 19:19:56 +08:00
Steven Zou
b5b728bee3
Fix the vulnerability issues in the job service code
...
'Errors unhandled' in 'jobservice/job/impl/logger/job_logger.go'
'TLS InsecureSkipVerify set true' in 'jobservice/opm/hook_client.go'
2018-04-12 15:12:39 +08:00
Steven Zou
85ae40f5ec
Apply auth checking to all the incoming requests
2018-04-08 18:12:13 +08:00
Steven Zou
529ad3e079
Merge pull request #4593 from vmware/add_more_log_2_js
...
Fix issue: failed to update the status of job if runtme error occurred
2018-04-08 14:03:34 +08:00
Steven Zou
233692c127
fix issue: job context may be nil pointer when trying to be closed in defer func
2018-04-08 13:03:23 +08:00
Steven Zou
1cb40368f5
Fix issue: failed to update the status of job if runtme error occurred
2018-04-08 10:38:47 +08:00
Tan Jiang
ff06ec05c3
Store secret in header instead of cookie
2018-04-07 22:02:06 +08:00
Tan Jiang
15580a5e8c
Read the system properties from scan job context
2018-04-04 19:58:54 +08:00
Steven Zou
6c69a8cd05
Fix issue of stopping periodic job
...
improve op command by using cache
return 404 if no job found to stop
2018-04-02 18:08:03 +08:00
Steven Zou
fee7f6ddef
Merge branch 'job_service' into switch_job_service
2018-04-02 12:06:23 +08:00
Steven Zou
250360307b
Modify docker compose file template and make file to enable new job service
...
Fix typo in Makefile under photon
Fix version tag issue of redis container
Assign container name for redis container
Update docker compose template to enable network for redis
Remove exposed ports of redis from compose yaml tpl
2018-03-30 16:52:55 +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
yixingj
cb64ad96ff
Make endpoint configurable
...
Move all the endpoint to harbor.cfg
2018-03-26 10:50:18 +08:00
Wenkai Yin
9022abfc13
Fix code issues found by Gas
2018-01-29 15:17:03 +08:00
Wenkai Yin
4070ed5152
Provide a mechanism to stop pending and retrying jobs
2018-01-12 15:29:20 +08:00
Wenkai Yin
3be1d5a7fd
Assign read-only privilege of replication policy to project admin and add stopping replication jobs API.
2017-12-25 23:49:21 +08:00
Wenkai Yin
260ef561c4
Update the HTTP client for easy use by add more util functions
2017-12-16 06:45:59 +08:00
Wenkai Yin
a736cb7b09
Update the HTTP client according to the comments
2017-12-15 09:40:31 +08:00
Wenkai Yin
b5e7de331e
Delete enabled and start_time properties of replication rule
2017-12-15 09:40:31 +08:00
Wenkai Yin
fe10c2e7f5
Create replicator to submit replication job to jobservice
2017-12-15 09:40:31 +08:00
Daniel Jiang
cdadc94d0f
Merge pull request #3804 from ywk253100/171215_jobservice
...
Print stack trace when recover from panic and print warning message rather than returning an error when updating 0 records
2017-12-18 16:36:20 +08:00
stonezdj
9393d26fdc
Fix ldap ping issue #3653
2017-12-15 14:47:54 +08:00
Wenkai Yin
43489c2b67
Print stack trace when recover from panic and print warning message rather than returning an error when updating 0 records
2017-12-14 13:48:45 +08:00
Tan Jiang
b3e0af2382
Fix permission issue in job_log directory
2017-11-21 19:31:15 +08:00
Daniel Jiang
a2f20801c0
Merge pull request #3597 from ywk253100/171110_bug_fix
...
Add content-type header to the request when creating project during replication
2017-11-12 22:54:15 -06:00
Wenkai Yin
9889896e8a
Add content-type header to the request when creating project during replication
2017-11-10 16:08:13 +08:00
reasonerjt
19a13e8575
Deprivilege harbor-ui harbor-jobservice harbor-adminserver
...
Use non-root user to run the service within these docker images, and provide HEALTHCHECK
mechanism.
2017-11-09 03:09:09 -08:00
Tan Jiang
512384722a
Make the internal URL of UI and JobService configurable
2017-11-03 20:43:25 +08:00
Wenkai Yin
2156750b04
Move certificate verification to target level
...
The certificate verification is on system level before this commit. Moving it
to target level makes the configuration more flexible for different targets.
2017-10-20 15:36:56 +08:00
Wenkai Yin
66b2d0d3f3
Apply project level policies to standalone Harbor
...
The following features are only enabled in integration mode, this commit moves
these to standalone Harbor:
- Content trust policy: only signed images can be pulled
- Vulnerability policy: only images whose severity is below the threshold can be pulled
- Automatic scan policy: automatic scan pushed images
2017-10-19 17:33:28 +08:00
Wenkai Yin
f0946b63cf
fix code style issues reported by golint
2017-09-19 17:16:54 +08:00