Skip to content

Initial Issues Encountered While Setting Up miqa #111

@davidshq

Description

@davidshq

Just wanted to share the issues I ran into as I began setting up miqa:

  1. I'm using Windows 10 Pro w/Windows Subsystem for Linux 2 running Ubuntu 20.04.
  2. VS Code 1.56.0 is my editor and I'm using the Remote - Containers extension 0.177.0.
  3. I cloned the miqa repository into my WSL2 Ubuntu instance and then from within the miqa folder launched VS Code (code .). This launches VS Code from within WSL.
  4. I prefer to use an isolated Docker container for actual development and VSC's Remote - Containers extension handles this nicely (Command Palette --> Remote-Containers: Reopen in Remote Container --> allows to select from prebuilt templates). See later for contents of devcontainer.json and Dockerfile.
  5. I reopen the project in the container.
  6. I open VSC's Terminal (which is running within the container) and execute pip install -e miqa/server and receive the following warning/error:
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /usr/local/include/python3.9/UNKNOWN
sysconfig: /usr/local/include/python3.9
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
Defaulting to user installation because normal site-packages is not writeable
ERROR: miqa/server is not a valid editable requirement. It should either be a path to a local project 
or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, 
git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, 
svn+ssh, svn+http, svn+https, svn+svn, svn+file).
WARNING: You are using pip version 21.1; however, version 21.1.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
  1. Eliminating the first two warnings can be accomplished by heeding the third and upgrading pip: python -m pip install --upgrade pip.
  2. Rerunning pip install -e miqa/server returns the same error without warnings:
Defaulting to user installation because normal site-packages is not writeable
ERROR: miqa/server is not a valid editable requirement. It should either be a path to a local project 
or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, 
git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, 
svn+ssh, svn+http, svn+https, svn+svn, svn+file).
  1. I realize that in the repository there is no miqa folder only a server folder so I run instead pip install -e server and this works. I assume if I had navigated outside of the repo folder and run pip install -e miqa/server it would have worked...and strictly speaking the instructions in development.md don't say to enter the repo, may be worth adding verbiage noting that if one does enter the repo one needs to remove miqa/ from the pip command.
  2. I run girder build, the first steps - installing npm packages run fine. As does @girder/meta-build@ build /home/vscode/.local/lib/python3.9/site-packages/girder/web_client.
  3. girder build next attempts to run grunt "--girder-version=3.1.4" "--static-path=/usr/local/share/girder/static" --"static-public-path=/static" "--no-progress=false" "--env=prod" and while running the "webpack:core_lib" (webpack) task throws an error at 94% asset optimization:
Warning: EACCES: permission denied, mkdir '/usr/local/share/girder' Use --force to continue.

Aborted due to warnings.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! @girder/meta-build@ build: `grunt "--girder-version=3.1.4" "--static-path=/usr/local/share/girder/static" 
"--static-public-path=/static" "--no-progress=false" "--env=prod"`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the @girder/meta-build@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vscode/.npm/_logs/2021-05-07T16_08_20_911Z-debug.log
Traceback (most recent call last):
  File "/home/vscode/.local/bin/girder", line 8, in <module>
    sys.exit(main())
  File "/home/vscode/.local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/vscode/.local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/vscode/.local/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vscode/.local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vscode/.local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/vscode/.local/lib/python3.9/site-packages/girder/cli/build.py", line 104, in main
    check_call(buildCommand, cwd=staging)
  File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['npm', 'run', 'build', '--', '--girder-version=3.1.4', 
'--static-path=/usr/local/share/girder/static', '--static-public-path=/static', '--no-progress=false',
'--env=prod']' returned non-zero exit status 3.

This is where I am at the moment. I'll update if I make further progress.

Contents of devcontainer.json:

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/python-3
{
	"name": "Python 3",
	"build": {
		"dockerfile": "Dockerfile",
		"context": "..",
		"args": { 
			// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
			"VARIANT": "3.9",
			// Options
			"INSTALL_NODE": "true",
			"NODE_VERSION": "lts/*"
		}
	},

	// Set *default* container specific settings.json values on container create.
	"settings": { 
		"terminal.integrated.shell.linux": "/bin/bash",
		"python.pythonPath": "/usr/local/bin/python",
		"python.linting.enabled": true,
		"python.linting.pylintEnabled": true,
		"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
		"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
		"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
		"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
		"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
		"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
		"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
		"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
		"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
	},

	// Add the IDs of extensions you want installed when the container is created.
	"extensions": [
		"ms-python.python"
	],

	// Use 'forwardPorts' to make a list of ports inside the container available locally.
	// "forwardPorts": [],

	// Use 'postCreateCommand' to run commands after the container is created.
	// "postCreateCommand": "pip3 install --user -r requirements.txt",

	// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
	"remoteUser": "vscode"
}

Contents of Dockerfile

# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
#    && rm -rf /tmp/pip-tmp

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
#     && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions