Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(snap): kong migrations up before Kong startup #4223

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

farshidtz
Copy link
Member

@farshidtz farshidtz commented Oct 26, 2022

Fixes #4221

Also, bumps to latest stable kong, i.e. 2.8.2.

Signed-off-by: Farshid Tavakolizadeh [email protected]

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

snap install edgexfoundry --channel=latest/stable

# build and install on top
snapcraft
snap install <name>.snap --dangerous

# OR refresh from the snap build from this PR
snap refresh edgexfoundry --channel=latest/edge/pr-4223

New Dependency Instructions (If applicable)

MonicaisHer
MonicaisHer previously approved these changes Oct 26, 2022
Copy link
Contributor

@MonicaisHer MonicaisHer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@farshidtz Thank you, looks good. Here is my test result:

$ snap install edgexfoundry --channel=latest/stable
edgexfoundry 2.2.0+2 from Canonical✓ installed
$ snap refresh edgexfoundry --channel=latest/edge/pr-4223
edgexfoundry (edge/issue-4221) 2.3.0-dev.99 from Canonical✓ refreshed

$ snap logs -f edgexfoundry.kong-daemon
2022-10-26T16:33:19+02:00 systemd[1]: Stopping Service for snap application edgexfoundry.kong-daemon...
2022-10-26T16:33:19+02:00 edgexfoundry.kong-daemon[663847]: Kong stopped
2022-10-26T16:33:19+02:00 systemd[1]: snap.edgexfoundry.kong-daemon.service: Succeeded.
2022-10-26T16:33:19+02:00 systemd[1]: Stopped Service for snap application edgexfoundry.kong-daemon.
2022-10-26T16:33:39+02:00 systemd[1]: Starting Service for snap application edgexfoundry.kong-daemon...
2022-10-26T16:33:39+02:00 edgexfoundry.kong-daemon[664409]: 2022/10/26 16:33:39 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
2022-10-26T16:33:39+02:00 edgexfoundry.kong-daemon[664409]: migrating core on database 'kong'...
2022-10-26T16:33:39+02:00 edgexfoundry.kong-daemon[664409]: core migrated up to: 014_230_to_270 (executed)
2022-10-26T16:33:39+02:00 edgexfoundry.kong-daemon[664409]: core migrated up to: 015_270_to_280 (executed)
2022-10-26T16:33:39+02:00 edgexfoundry.kong-daemon[664409]: 2 migrations processed
2022-10-26T16:33:39+02:00 edgexfoundry.kong-daemon[664409]: 2 executed
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664426]: parse successful, beginning import
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664426]: import successful
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] Kong: 2.8.2
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] reading config file at /var/snap/edgexfoundry/4065/config/security-proxy-setup/kong.conf
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] prefix in use: /var/snap/edgexfoundry/current/kong
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] preparing nginx prefix directory at /var/snap/edgexfoundry/current/kong
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] SSL enabled on
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] proxy SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/kong-default.crt
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] proxy SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/kong-default-ecdsa.crt
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] SSL enabled on
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] admin SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/admin-kong-default.crt
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] admin SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/admin-kong-default-ecdsa.crt
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] retrieving database schema state...
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [verbose] schema state retrieved
2022-10-26T16:33:40+02:00 edgexfoundry.kong-daemon[664439]: 2022/10/26 16:33:40 [info] Kong started
2022-10-26T16:33:40+02:00 systemd[1]: Started Service for snap application edgexfoundry.kong-daemon.

@codecov-commenter
Copy link

Codecov Report

Merging #4223 (0c27a56) into main (8ec1737) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #4223   +/-   ##
=======================================
  Coverage   43.29%   43.29%           
=======================================
  Files         125      125           
  Lines       11126    11126           
=======================================
  Hits         4817     4817           
  Misses       5896     5896           
  Partials      413      413           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Farshid Tavakolizadeh <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
4.1% 4.1% Duplication

Copy link
Contributor

@MonicaisHer MonicaisHer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the result of refresh test:

$ snap install edgexfoundry --channel=latest/stable
edgexfoundry 2.2.0+2 from Canonical✓ installed
$ snap refresh edgexfoundry --channel=edge/pr-4223 
edgexfoundry (edge/pr-4223) 2.3.0-dev.99 from Canonical✓ refreshed

$ snap logs -f edgexfoundry.kong-daemon
Okt 26 17:05:28 ubuntu systemd[1]: Stopping Service for snap application edgexfoundry.kong-daemon...
Okt 26 17:05:28 ubuntu edgexfoundry.kong-daemon[10001]: Kong stopped
Okt 26 17:05:28 ubuntu systemd[1]: snap.edgexfoundry.kong-daemon.service: Succeeded.
Okt 26 17:05:28 ubuntu systemd[1]: Stopped Service for snap application edgexfoundry.kong-daemon.
Okt 26 17:05:32 ubuntu snapd[1208]: services.go:1046: RemoveSnapServices - disabling snap.edgexfoundry.kong-daemon.service
Okt 26 17:05:33 ubuntu audit[10117]: AVC apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.edgexfoundry.kong-daemon" pid=10117 comm="apparmor_parser"
Okt 26 17:05:59 ubuntu systemd[1]: Starting Service for snap application edgexfoundry.kong-daemon...
Okt 26 17:05:59 ubuntu edgexfoundry.kong-daemon[10570]: 2022/10/26 17:05:59 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Okt 26 17:05:59 ubuntu edgexfoundry.kong-daemon[10570]: Database already bootstrapped
Okt 26 17:05:59 ubuntu edgexfoundry.kong-daemon[10582]: 2022/10/26 17:05:59 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10582]: migrating core on database 'kong'...
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10582]: core migrated up to: 014_230_to_270 (executed)
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10582]: core migrated up to: 015_270_to_280 (executed)
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10582]: 2 migrations processed
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10582]: 2 executed
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10599]: parse successful, beginning import
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10599]: import successful
Okt 26 17:06:00 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [warn] ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] Kong: 2.8.2
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] reading config file at /var/snap/edgexfoundry/4066/config/security-proxy-setup/kong.conf
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] prefix in use: /var/snap/edgexfoundry/current/kong
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] preparing nginx prefix directory at /var/snap/edgexfoundry/current/kong
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] SSL enabled on
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] proxy SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/kong-default.crt
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] proxy SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/kong-default-ecdsa.crt
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] SSL enabled on
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] admin SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/admin-kong-default.crt
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:00 [verbose] admin SSL certificate found at /var/snap/edgexfoundry/current/kong/ssl/admin-kong-default-ecdsa.crt
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:01 [verbose] retrieving database schema state...
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:01 [verbose] schema state retrieved
Okt 26 17:06:01 ubuntu edgexfoundry.kong-daemon[10612]: 2022/10/26 17:06:01 [info] Kong started
Okt 26 17:06:01 ubuntu systemd[1]: Started Service for snap application edgexfoundry.kong-daemon.

@farshidtz farshidtz marked this pull request as ready for review October 26, 2022 15:22
@farshidtz farshidtz merged commit c8dc4aa into edgexfoundry:main Oct 26, 2022
@farshidtz farshidtz deleted the snap-kong-migration-up branch October 26, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kong error upgrading from 2.2.0 to 2.3.0-dev.102
3 participants