diff --git a/.dockerignore b/.dockerignore index 2e05d2c9b7d..d4e31f2c7a2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,3 @@ +.k8s_ci.Dockerfile .venv database diff --git a/.gitignore b/.gitignore index ea4673509d6..5f286aff736 100644 --- a/.gitignore +++ b/.gitignore @@ -162,10 +162,7 @@ client/galaxy doc/build doc/schema.md doc/source/admin/config_logging_default_yaml.rst -doc/source/api/api.rst -doc/source/api/ts_api.rst doc/source/dev/schema.md -doc/source/dev/schema.rst client/styleguide # webpack stats diff --git a/.k8s_ci.Dockerfile b/.k8s_ci.Dockerfile index c2580717e7d..fab33a27f77 100644 --- a/.k8s_ci.Dockerfile +++ b/.k8s_ci.Dockerfile @@ -1,12 +1,18 @@ # Stage 1: # - base: ubuntu (default) OR prebuilt image0 # - install build tools -# - run playbook (image0 avoids rerunning lengthy tasks) +# - clone playbook +# Stage 2: build galaxy client and server in parallel +# Stage 2.1: +# - run playbook with server build steps only # - remove build artifacts + files not needed in container -# Stage 2: +# Stage 2.2: +# - run playbook with client build steps only +# - remove build artifacts + files not needed in container +# Stage 3: # - install python-virtualenv # - create galaxy user + group + directory -# - copy galaxy files from stage 1 +# - copy galaxy files from stage 2.1 and 2.2 # - finalize container (set path, user...) # Init ARGs @@ -16,12 +22,14 @@ ARG SERVER_DIR=$ROOT_DIR/server # For much faster build time override this with image0 (Dockerfile.0 build): # docker build --build-arg BASE=... ARG STAGE1_BASE=ubuntu:20.04 -ARG STAGE2_BASE=$STAGE1_BASE +ARG FINAL_STAGE_BASE=$STAGE1_BASE # NOTE: the value of GALAXY_USER must be also hardcoded in COPY in final stage ARG GALAXY_USER=galaxy ARG GALAXY_PLAYBOOK_REPO=https://github.com/galaxyproject/galaxy-docker-k8s -# Stage-1 +#====================================================== +# Stage 1 - Setup common requirements for build +#====================================================== FROM $STAGE1_BASE AS stage1 ARG DEBIAN_FRONTEND=noninteractive ARG SERVER_DIR @@ -61,7 +69,14 @@ RUN ansible-galaxy install -r requirements.yml -p roles --force-with-deps # Add Galaxy source code COPY . $SERVER_DIR/ -RUN ansible-playbook -i localhost, playbook.yml -v + +#====================================================== +# Stage 2.1 - Build galaxy server +#====================================================== +FROM stage1 AS server_build +ARG SERVER_DIR + +RUN ansible-playbook -i localhost, playbook.yml -v -e galaxy_build_client=False RUN cat /galaxy/server/lib/galaxy/dependencies/conditional-requirements.txt | grep psycopg2-binary | xargs /galaxy/server/.venv/bin/pip install @@ -72,7 +87,6 @@ RUN git rev-parse HEAD > GITREVISION RUN rm -rf \ .ci \ .git \ - .venv/bin/node \ .venv/include/node \ .venv/src/node* \ doc \ @@ -81,8 +95,30 @@ RUN rm -rf \ # Clean up *all* node_modules, including plugins. Everything is already built+staged. RUN find . -name "node_modules" -type d -prune -exec rm -rf '{}' + -# Stage-2 -FROM $STAGE2_BASE +#====================================================== +# Stage 2.2 - Build galaxy client +#====================================================== +FROM stage1 AS client_build +ARG SERVER_DIR + +RUN ansible-playbook -i localhost, playbook.yml -v --tags "galaxy_build_client" + +WORKDIR $SERVER_DIR +RUN rm -rf \ + .ci \ + .git \ + .venv/include/node \ + .venv/src/node* \ + doc \ + test \ + test-data +# Clean up *all* node_modules, including plugins. Everything is already built+staged. +RUN find . -name "node_modules" -type d -prune -exec rm -rf '{}' + + +#====================================================== +# Stage 3 - Build final image based on previous stages +#====================================================== +FROM $FINAL_STAGE_BASE ARG DEBIAN_FRONTEND=noninteractive ARG ROOT_DIR ARG SERVER_DIR @@ -115,7 +151,8 @@ RUN set -xe; \ WORKDIR $ROOT_DIR # Copy galaxy files to final image # The chown value MUST be hardcoded (see #35018 at github.com/moby/moby) -COPY --chown=galaxy:galaxy --from=stage1 $ROOT_DIR . +COPY --chown=galaxy:galaxy --from=server_build $ROOT_DIR . +COPY --chown=galaxy:galaxy --from=client_build $SERVER_DIR/static ./server/static WORKDIR $SERVER_DIR EXPOSE 8080 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6af16ec22d2..50676c0f24d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,10 @@ Git](https://swcarpentry.github.io/git-novice/) tutorial is a good place to start. More learning resources are listed at https://help.github.com/en/github/getting-started-with-github/git-and-github-learning-resources -1. Make sure you have a free [GitHub](https://github.com/) account. +1. Make sure you have a free [GitHub](https://github.com/) account. To increase + the security of your account, we strongly recommend that you configure + [two-factor authentication](https://docs.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa). + Additionally, you may want to [sign your commits](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification). 2. Fork the [galaxy repository](https://github.com/galaxyproject/galaxy) on GitHub to make your changes. To keep your copy up to date with respect to diff --git a/Makefile b/Makefile index 0815ade564c..938f7bf63fd 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,9 @@ docs: ## Generate HTML documentation. $(IN_VENV) $(MAKE) -C doc clean $(IN_VENV) $(MAKE) -C doc html +docs-develop: ## Fast doc generation and more warnings (for development) + $(IN_VENV) GALAXY_DOCS_SKIP_VIEW_CODE=1 SPHINXOPTS='-j 4' $(MAKE) -C doc html + setup-venv: if [ ! -f $(VENV)/bin/activate ]; then bash scripts/common_startup.sh --dev-wheels; fi diff --git a/client/gulpfile.js b/client/gulpfile.js index 015f572fda8..727ea665282 100644 --- a/client/gulpfile.js +++ b/client/gulpfile.js @@ -22,6 +22,7 @@ const PLUGIN_BUILD_IDS = [ "openlayers", "openseadragon", "pv", + "nora", ]; const paths = { diff --git a/client/src/components/DatasetInformation/DatasetInformation.test.js b/client/src/components/DatasetInformation/DatasetInformation.test.js index 5fa47ff2e5f..dfc341eb83b 100644 --- a/client/src/components/DatasetInformation/DatasetInformation.test.js +++ b/client/src/components/DatasetInformation/DatasetInformation.test.js @@ -1,6 +1,7 @@ import axios from "axios"; import MockAdapter from "axios-mock-adapter"; import { mount } from "@vue/test-utils"; +import { getLocalVue } from "jest/helpers"; import DatasetInformation from "./DatasetInformation"; import datasetResponse from "./testData/datasetResponse"; import flushPromises from "flush-promises"; @@ -18,6 +19,8 @@ const mockDatasetProvider = { }, }; +const localVue = getLocalVue(); + describe("DatasetInformation/DatasetInformation.vue", () => { let wrapper; let datasetInfoTable; @@ -42,6 +45,7 @@ describe("DatasetInformation/DatasetInformation.vue", () => { stubs: { DatasetProvider: mockDatasetProvider, }, + localVue, }); datasetInfoTable = wrapper.find("#dataset-details"); await flushPromises(); diff --git a/client/src/components/FilesDialog/FilesInput.vue b/client/src/components/FilesDialog/FilesInput.vue index a56a184af73..261eb807fb2 100644 --- a/client/src/components/FilesDialog/FilesInput.vue +++ b/client/src/components/FilesDialog/FilesInput.vue @@ -1,5 +1,6 @@