Commit Graph

125 Commits

Author SHA1 Message Date
Daniel Jiang
b8777a7cc3
Merge pull request #9276 from das-peter/patch-1
#9174 config migration fails with python error: jinja2.exceptions.UndefinedError: 'chart' is undefined
2019-11-08 14:20:53 +08:00
Peter Philipp
d964bf5c35 Possible fix for: https://github.com/goharbor/harbor/issues/9174
Signed-off-by: Peter Philipp <peter.philipp@cando-image.com>
2019-10-30 12:42:48 -04:00
DQ
0b26e2c89f Add migrator for harbor 1.10.0
add 1.10.0 template for migration

Signed-off-by: DQ <dengq@vmware.com>
2019-10-28 20:41:32 +08:00
DQ
377739204b Update config file names
Signed-off-by: DQ <dengq@vmware.com>
2019-09-02 18:19:06 +08:00
He Weiwei
e2a19d8ab9
fix(build): max idle and open conn settings for external db (#8854)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2019-08-29 15:04:10 +08:00
DQ
fd7b867fe3 Add config template
Add upgrade script
Update latest version

Signed-off-by: DQ <dengq@vmware.com>
2019-08-22 17:23:33 +08:00
DQ
c1c48ea757 Fix migration script to support exeternal db
migrated config file will contains seperated db configuration

Signed-off-by: DQ <dengq@vmware.com>
2019-06-25 19:00:31 +08:00
Daniel Jiang
64b16c8915 Enable cfg migration from v1.8.0 (#7751)
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2019-05-10 13:14:46 +08:00
Qian Deng
bb66358df8 Update migratrion script (#7728)
* Fix migration script

1. port is string when parsed from configparser
2. remove index and db_user in if condition

Signed-off-by: Qian Deng <dengq@vmware.com>

* Add port to public_url

Add port to public_url

Signed-off-by: Qian Deng <dengq@vmware.com>

* Customized value for notary and clair

db config in notary and clair is hardcoded

Signed-off-by: Qian Deng <dengq@vmware.com>

* Add notary and clair db config in harbor.yml

Add notary clair config to harbor.yml and fix related regression

Signed-off-by: Qian Deng <dengq@vmware.com>
2019-05-10 10:44:05 +08:00
Daniel Jiang
546bd44047 Require output path for harbor.cfg->harbor.yml migration
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2019-05-09 19:11:22 +08:00
Daniel Jiang
3a1ffb3c49 Update migrator to support only from >=v1.6.0
This commit removes code to support upgrade from <v1.6.0
It also removes packages for supporting mysql/mariadb from Dockerfile

It does not handle the optimization in the script such as run.sh after the update.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2019-05-06 22:46:58 -07:00
Qian Deng
c1e676ad99 Add migration script from 1.7.0 to 1.8.0
Add jinja2 to migrator
Add template to migrator
Add config upgrading script

Signed-off-by: Qian Deng <dengq@vmware.com>
2019-04-17 15:14:54 +08:00
Qian Deng
ba4764c61d
Merge pull request #6755 from ninjadq/refactor_prepare
Refactor the prepare script
2019-03-22 14:54:30 +08:00
Qian Deng
93af296eeb Enhance: refactor the mount dirs and workflow of generate cert
mount a temp dir input for all input files and configs
generated secrets file stored in data volumns keys dir
certs file stored in data volumns nginx dir

Signed-off-by: Qian Deng <dengq@vmware.com>
2019-03-15 15:51:11 +08:00
wang yan
f49b5910d2 disable non zern check on wait for db ready
Signed-off-by: wang yan <wangyan@vmware.com>
2019-03-09 12:52:38 +08:00
wang yan
7d6cdefae6 add script to fix migration issue on notary
The script is to fix the issue #7091, notary upgrade failure from mysql to pqsl.

Signed-off-by: wang yan <wangyan@vmware.com>
2019-03-08 20:29:23 +08:00
Qian Deng
b0f158c4c8 Add migratior script
Add migrator template and script

Signed-off-by: Qian Deng <dengq@vmware.com>
2019-03-08 16:46:14 +08:00
Daniel Jiang
091ed91ad8 Install psycopg2 via photon's repo (#7018)
The psycopg2 installed by pip has very old `.so` files.
This commit will mitigate such issue by using `tdnf` to install this package.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2019-02-26 10:58:05 +08:00
wang yan
cd50d85c47 Upgrade migrator base os to photon 2.0
Signed-off-by: wang yan <wangyan@vmware.com>
2019-02-14 11:35:44 +08:00
Yan
5412e581de
Add a flag judging on building migrator (#6905)
This commit is to add a flag judging when to build image of migator, which is not necessary.

Signed-off-by: wang yan <wangyan@vmware.com>
2019-02-12 20:33:42 +08:00
wang yan
7936d14abc fix per comments, add if not exists to create pqsql sequence
Signed-off-by: wang yan <wangyan@vmware.com>
2018-12-08 16:11:30 +08:00
wang yan
0517ecca7a Fix unable to use Notary after updating to v1.6.0
This commit is to fix the issue on notary migrations from mysql to pgsql.
1, alter sequence for the primary key of changeseed, this is missed in v1.6.0 migrator.
2, alter table owners from postgres to notarysigner and notaryserver.

Issue:
https://github.com/goharbor/harbor/issues/6465

Workaround:
https://github.com/goharbor/harbor/issues/6465#issuecomment-445162616

Impacted upgrade path:
1, Upgrade from version older then v1.6.0 with migrator:v1.6.0, and migrates the notarty DB.

No impacted upgrade path:
1, Upgrade from version older than v1.6.0 with migrator:v1.6.0, but without migrates the notarty DB.

Notes:
After merge this fix, we need to provide an new migrator with an new tag, like v1.6.1, and
deprecated the v1.6.0. For those who was impacted by migrator v1.6.0, will open an new PR to build
the workaround into the migrator and expose an specical command for hot-fix.

Signed-off-by: wang yan <wangyan@vmware.com>
2018-12-07 19:33:44 +08:00
Daniel Jiang
2a9d46e052 Update no_proxy from 'portal' to 'core' in cfg migrator (#6464)
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-12-06 11:49:40 +08:00
Qian Deng
7647e688fd Feat: Upgrade harbor.cfg from 1.6.0 to 1.7.0
Add script to upgrade harbor.cfg

Signed-off-by: Qian Deng <dengq@vmware.com>
2018-12-04 10:36:11 +08:00
Brett Johnson
f3640acf67 corrected tdnf build install command.
build failing due to tdnf attempting to install
x86_64/gcc-5.3.0-5.ph1.x86_64.rpm

Signed-off-by: Brett Johnson <brett@sdbrett.com>
2018-11-29 17:55:23 +11:00
Brett Johnson
2d134c2f21 corrected tdnf build install command.
build failing due to tdnf attempting to install
x86_64/gcc-5.3.0-5.ph1.x86_64.rpm

Signed-off-by: Brett Johnson <brett@sdbrett.com>
2018-11-29 16:30:27 +11: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
wang yan
b3918fe748 Add the encoding to the data converter script
This commit is to fix bug reported by community to upgrade v1.6.0, for the details
just refer to #5788. The fix is to add the encoding(utf-8) for the converter when to convert
the mysql data to pqsql data. Already passed on test with Chinese/Japanese.

Signed-off-by: wang yan <wangyan@vmware.com>

update
2018-09-04 12:02:48 +08:00
wang yan
f8b964d8cf Extend configuration length to 1024 in DB
Signed-off-by: wang yan <wangyan@vmware.com>
2018-08-31 13:42:24 +08:00
Daniel Jiang
1d4f991901
Merge pull request #5640 from wy65701436/deprecate-ova
deprecate ova for harbor repository
2018-08-24 13:38:42 +08:00
wang yan
aacbf229d6 deprecate ova for harbor repository
This commit is to remove the document/tests of ova from harbor repository as decide to deprecate
ova installer in the future release.

Signed-off-by: wang yan <wangyan@vmware.com>
2018-08-24 13:05:01 +08:00
Qian Deng
ee9e80ddb1 Delete uilib directory
Not need publish version after ci suceess any more, so remove them

Signed-off-by: Qian Deng <dengq@vmware.com>
2018-08-23 17:54:54 +08:00
Daniel Jiang
bda3878ab8 Update registry image to enable inject root cert
In some user's environment, there's local object storage hosted with
self-signed certificate.
Because registry process runs in a photon container, it has to trust
the certificate in the photon level such that the registry can access
the storage service.

This commit updates the registry image to append custom cert to the root
bundle when the container is started.  And make the customer cert
configurable in `harbor.cfg`

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-08-16 18:36:21 +08:00
Daniel Jiang
3dc95ee7e2 Update CFG migrator to match the new redis setting (#5567)
There's a limitation in the new harbor.cfg file the redis url will be
hard coded to the internal redis instance.  We expect user to manually
edit the .cfg file if he's using a customized redis, this would be a
very rare case.  We'll mention it in the release note of 1.6
2018-08-09 15:30:35 +08:00
wangyan
063e44c486 Remove the tdnf error eater in docker files 2018-08-07 22:58:01 -07:00
wangyan
e89f72e081 Add default value for creation time and update time trigger
These chanes are introduced by PR 5430, please refer to the PR for details
2018-07-30 23:48:46 -07:00
wangyan
22411cf6b2 Fix pgsql creation column bug
Root cause: Use default 'now'::timestamp will not generate timestamp for each transaction,
PG will convert now to a timestamp as soon as the constant is parsed. To fix it, update it
to defult CURRENT_TIMESTAMP, thie setting is the same as default now(), which returns the
start time of current transaction because ther are fuction calls, hey will give the desired
behavior of defaulting to the time of row insertion.

Reference: https://www.postgresql.org/docs/9.6/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT
PG version: 9.6.9
2018-07-30 04:58:44 -07:00
Daniel Jiang
46de1432f2 Enable cfg migrator to 1.6.0
In 1.6, there will be only one DB process in the default deployment.
The migrator will try to handle the setting by "guessing" whether Harbor
was pointed to external DB.

Verified 1.5->1.6 and 1.4->1.6 migration.
2018-07-27 17:11:45 +08:00
wangyan
5b492ee321 Update migrator for support new table admin_job 2018-07-24 20:29:56 -07:00
Daniel Jiang
6c664ee993 Update photon base images (#5346)
This commit update the base photon image from vmware/photon:1.0 to
photon:1.0, per suggestion by photon team.
2018-07-19 20:45:20 +08:00
Deng, Qian
edbe2fe620 Update migrator to 1 6 0
1. Add new alembic_pg folder for postgres
2. Add migration file for 1.6.0
3. Update version to 1.6.0
4. update migrator dockerfile
2018-07-02 21:23:47 +08:00
wangyan
2379123ff7 fix up clair issue and typo 2018-06-10 23:33:37 -07:00
wangyan
8d4d1582a3 add checking for clair DB migration 2018-06-10 20:15:55 -07:00
wangyan
c7a54e115c Add clair data migration in DB migrator 2018-06-08 01:49:28 -07:00
Wenkai Yin 79628
0c56493fb6 Soft delete label
Modify the deletion of label to soft deletion, in this way the names of deleted labels referenced by replication rules can be shown to users
2018-06-07 17:14:12 +08:00
Yan
6d800cabbd
enable migrator to support 1.5.0 migration from mysql to pgsql (#5029)
This commit is to enable data migrator to support migrates data
from mysql to pgsql, this is a specific step for user to upgrade
harbor across v1.5.0, as we have move harbor DB to pgsql from
1.5.0. It supports both harbor and notary db data migration,
and be split into two steps with dependency.

It also fix issue #4847, add build DB migrator in make process.
2018-06-01 14:58:43 +08:00
Wenkai Yin
5f58c01e4a Fix bug #4840 (#4851)
Fix the bug: upgrade failed in VIC if replication policies exist
2018-05-02 09:37:35 -07:00
wangyan
2b3d70357e Overwrite some attributes in harbor.cfg 1.5
The values of "redis_url" and "max_job_workers" should be set to new
values due to new implementation.
2018-05-01 09:28:29 +08:00
Wenkai Yin
73babbf1ab Modify unique constraint of table harbor_label
Add unique constraint to column name, scope and project_id  of table harbor_label to make creating same name labels under different projects valid
2017-12-19 22:15:56 +08:00
Yan
bc473f8521
Enable output parameter in harbor migrator (#4561) 2018-04-02 03:04:00 -07:00