mintproject / mic

Model Insertion Checker
https://mic-cli.readthedocs.io/en/latest/
5 stars 3 forks source link

If a component starts with a capital letter, MIC fails #298

Closed dgarijo closed 3 years ago

dgarijo commented 4 years ago

Starting a component with a capital letter leads to an error because Docker images cannot start with capital letters. We should be able to deal with this by making the associated image non-capital letter; or printing a proper error with the warning.

Stacktrace:

(mic_env) PS C:\Users\dgarijo\Desktop\192\ttt> mic pkg start
WARNING: You are using mic version 1.3.2, however version 1.3.3 is available.
You should consider upgrading via the 'pip install --upgrade mic' command.
Model component name: Test
The directory mic already exists. If you continue, you can lose a previous component
Do you want to continue? [Y/n]: Y
MIC has initialized the component.
[Created] data:      C:\Users\dgarijo\Desktop\192\ttt\mic\data
[Created] docker:    C:\Users\dgarijo\Desktop\192\ttt\mic\docker
[Created] src:       C:\Users\dgarijo\Desktop\192\ttt\mic\src
[Created] mic.yaml:  C:\Users\dgarijo\Desktop\192\ttt\mic\mic.yaml
C:\Users\dgarijo\Desktop\192\ttt\mic\mic.yaml created
latest: Pulling from mintproject/generic
Digest: sha256:d99d739ed5cd06adb7584733fcb24be2907c488adc8ec913a3653a9a985c2580
Status: Image is up to date for mintproject/generic:latest
docker.io/mintproject/generic:latest
Downloading the base image and building your image
Traceback (most recent call last):
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\api\client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\requests\models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localnpipe/v1.35/build?t=Test&q=False&nocache=True&rm=False&forcerm=False&pull=False

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\dgarijo\Desktop\192\mic_env\Scripts\mic-script.py", line 11, in <module>
    load_entry_point('mic==1.3.2', 'console_scripts', 'mic')()
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\mic\click_encapsulate\commands.py", line 99, in start
    user_image = build_docker(mic_dir / DOCKER_DIR, name)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\mic\publisher\docker.py", line 21, in build_docker
    image, logs = client.images.build(path=str(docker_path), tag="{}".format(name), nocache=True)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\models\images.py", line 285, in build
    for chunk in internal_stream:
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\utils\json_stream.py", line 66, in split_buffer
    for data in stream_as_text(stream):
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\utils\json_stream.py", line 22, in stream_as_text
    for data in stream:
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\api\client.py", line 354, in _stream_helper
    yield self._result(response, json=decode)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\api\client.py", line 267, in _result
    self._raise_for_status(response)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\api\client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "c:\users\dgarijo\desktop\192\mic_env\lib\site-packages\docker\errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("invalid reference format: repository name must be lowercase")
issue-label-bot[bot] commented 4 years ago

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.88. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Cmheidelberg commented 4 years ago

Fixed: pending pr #297