mintproject / mic

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

Error when uploading component #260

Closed dgarijo closed 4 years ago

dgarijo commented 4 years ago

Tested by @brandomr

Model being encapsulated: https://github.com/jataware/refugee-trends

MIC version: 1.2.0

Description: The MIC component was originally tracked on the jataware/refugee-trends repo, but @brandomr copied the MIC folder in a separate folder. The error provided can be seen below

MIC file:

step: 1
name: refugee-trends
docker_image: refugee-trends:latest
framework: !!python/object/apply:mic.constants.Framework
- !!python/tuple
  - general
  - mintproject/generic:latest
parameters:
  input_file:
    default_value: Migration_GTrends.csv
    type: str
    description: The name of the Google Trends/refugee input file.
inputs:
  migration_gtrends_csv:
    path: Migration_GTrends.csv
    format: csv
code_files:
  model_r:
    path: model.R
    format: R
outputs:
  rplots_pdf:
    path: Rplots.pdf
    format: pdf
  accuracy_csv:
    path: accuracy.csv
    format: csv
github_repo_url: https://github.com/brandomr/refugee-trends.git

Error:

$ mic encapsulate upload
Automatically found mic.yaml in /home/ubuntu/refugee-mic-test/mic/mic.yaml
This step publishes your code, DockerImage and Model Configuration
Creating the git repository
Compressing your code
Creating a new commit
Creating or using the GitHub repository
The git repository has a remote server configured https://github.com/brandomr/refugee-trends.git
Creating a new version
Previous version 20.7.3
New version: 20.7.4
Pushing your changes to the server
Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/bin/mic", line 8, in <module>
    sys.exit(cli())
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mic/click_encapsulate/commands.py", line 545, in upload
    push(mic_config_path.parent, mic_config_path, name, profile)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mic/publisher/github.py", line 39, in push
    git_pull(repo, remote)
  File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/mic/publisher/github.py", line 127, in git_pull
    remote_master_id = repo.lookup_reference('refs/remotes/origin/%s' % (branch)).target
KeyError: 'refs/remotes/origin/master'

Other considerations:

API permisisons: image

User has 2FA enabled on GitHub, but I also have that enabled and it worked perfectly.

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.77. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

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

mosoriob commented 4 years ago

Fixed in the version 1.2.1 @brandomr can you update and test it?

pip install mic -U
brandomr commented 4 years ago

@mosoriob I'm now running that version but still see the same error:

$ mic version
mic v1.2.1
mosoriob commented 4 years ago

Can you share the stdout and mic directory?

dgarijo commented 4 years ago

Here it is @mosoriob The error log is the same (stdout) refugee-mic.zip

mosoriob commented 4 years ago

I have fixed that generates the problem, but Brandon has the problem.

Follow the next steps:

  1. Delete repository on GitHub
  2. rm -rf .git/
  3. git init
  4. mic encapsulate upload

https://asciinema.org/a/9kJO2Ixtwrpuoi0aKUYTrQp6T

In my computer fails because I dont have the base image: refugee-trends:latest

brandomr commented 4 years ago

@mosoriob that worked! Thanks for the help. I had to cd mic and run git remote remove origin but after that things worked fine.

$ mic encapsulate upload
Automatically found mic.yaml in /home/ubuntu/refugee-mic-test/mic/mic.yaml
This step publishes your code, DockerImage and Model Configuration
Creating the git repository
Compressing your code
Creating a new commit
Creating or using the GitHub repository
The git repository has not a remote server configured
Creating a new repository on GitHub
The url is: https://github.com/brandomr/refugee-trends.git
Creating a new version
Previous version 20.7.9
New version: 20.7.10
Pushing your changes to the server
Repository: https://github.com/brandomr/refugee-trends.git
Version: 20.7.10
Downloading the base image and building your image
Uploading the Docker Image
Docker Image: brandomr/refugee-trends:20.7.10
A model component must be associated with a model
Existing models are:
Do you want to use an existing model? [Y/n]: n
Please enter the information about the Model
Name of the model: Refugee Trends
A short description of the Model: Predicting refugees using Google Trends (development)
Version of the model: 0.1
A short description of the version: development version
Your Model Component has been uploaded
Success
You can run the Model using DAME
dame run 927791dd-7686-4cf5-9627-55f3bcd2cfcc -p default
mosoriob commented 4 years ago

You model looks fine:

https://rdfexplorer.mint.isi.edu/page/okn/i/mint/927791dd-7686-4cf5-9627-55f3bcd2cfcc