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

HDX-9931 - deploy ckan locally using devcontainers #6391

Draft
wants to merge 17 commits into
base: dev
Choose a base branch
from

Conversation

IanHopkinson
Copy link

@IanHopkinson IanHopkinson commented Jul 13, 2024

This PR includes changes required to deploy ckan locally into devcontainers for use with VS Code, developed on a Windows 11 machine.

The main action is in improving documentation in .devcontainer/README.md with some changes to the docker/hdxckantool-ng.py which implements the hdxckantool. There is a script to install the awscli in .devcontainer which is nasty (curls a file, unzips it and then installs, and my shell skills are limited) but as recommended by AWS. pip install awscli installs the old V1 CLI which is no longer recommended.

A bunch of JavaScript files appeared during installation, so I committed them. And there is a less folder which I deleted because at one point I thought it was blocking installation.

The devcontainer/README.md should get a developer to a point where they can run tests, and also deploy a slightly sluggish copy of the HDX Website. Reducing the docker mem_limit for the containers from 16GB each to 4GB each greatly reduced page render times (from ~2 minutes per page to 15 seconds). Possibly reducing mem_limit to 2GB will provide further improvement.

I can't add a login to HDX because recaptcha does not work on localhost.

The VS Code test runner fails during discovery, I think because the repo pins an older version of pytest/pluggy.
microsoft/vscode-python#23707

Next steps:

  1. See if test discovery in VS Code works if we update pytest and pluggy to latest versions;
  2. Add type-hinting to hdxckantool-ng.py;
  3. Check performance of local HDX with mem_limit so to 2GB;

This PR is provided for discussion and review. I think it needs some improvement.

@coveralls
Copy link

coveralls commented Jul 13, 2024

Pull Request Test Coverage Report for Build #5535

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 179 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.3%) to 71.694%

Files with Coverage Reduction New Missed Lines %
ckanext-hdx_package/ckanext/hdx_package/helpers/helpers.py 1 68.72%
ckanext-hdx_search/ckanext/init.py 1 0.0%
ckanext-hdx_users/ckanext/hdx_users/logic/schema.py 2 90.24%
ckanext-hdx_package/ckanext/hdx_package/helpers/custom_validator.py 4 82.37%
ckanext-hdx_search/ckanext/hdx_search/controller_logic/search_logic.py 17 85.05%
ckanext-hdx_package/ckanext/hdx_package/plugin.py 35 71.26%
ckanext-hdx_users/ckanext/hdx_users/views/onboarding.py 53 65.67%
ckanext-hdx_theme/ckanext/hdx_theme/helpers/helpers.py 66 59.63%
Totals Coverage Status
Change from base Build #5518: -0.3%
Covered Lines: 11780
Relevant Lines: 16431

💛 - Coveralls

Copy link
Member

@teodorescuserban teodorescuserban left a comment

Choose a reason for hiding this comment

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

  • I think you need to remove all .js and .css files committed.
  • The aws cli v2 installation might be perhaps better added in the Dockerfile , so you have it included already
  • Please remember than the hdxckantool is used on the shared infrastructure environments and needs to be able to operate correctly with both local development (where ckan can be the superuser and can remove and create databases) as well as on AWS RDS (where there is no readily available access at superuser) - I will need more time to review the hdxckantool changes
  • ending ith an empty new line is highly encouraged (even by gihub ui).

.devcontainer/awscli-install-run-once.sh Outdated Show resolved Hide resolved
.vscode/settings.json Outdated Show resolved Hide resolved
@IanHopkinson
Copy link
Author

@teodorescuserban to install awscli using Docker, do I just need to add the following to `.devcontainer/Dockerfile?

RUN /srv/ckan/.devcontainer/awscli-install-run-once.sh

ckanext/reclineview/theme/public/vendor/flotr2/flotr2.js Outdated Show resolved Hide resolved
ckanext-hdx_theme/ckanext/hdx_theme/less Outdated Show resolved Hide resolved
requirements.in Outdated Show resolved Hide resolved
@danmihaila danmihaila marked this pull request as draft July 18, 2024 11:37
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.

4 participants