arvados.git
10 years agoUpdate the documentation to reflect the new, safer build.sh --realclean
Ward Vandewege [Thu, 10 Jul 2014 16:38:00 +0000 (12:38 -0400)]
Update the documentation to reflect the new, safer build.sh --realclean
behavior.

refs #3219

10 years agoBe smarter about building and the --realclean option:
Ward Vandewege [Thu, 10 Jul 2014 16:20:43 +0000 (12:20 -0400)]
Be smarter about building and the --realclean option:

* remove intermediate containers after a successful build
* --realclean removes only images labelled arvados/*
* --realclean removes only arvados containers

refs #3219

10 years agoSanitize how we handle the --ssh option in the api docker container.
Ward Vandewege [Thu, 10 Jul 2014 15:17:08 +0000 (11:17 -0400)]
Sanitize how we handle the --ssh option in the api docker container.

refs #3219

10 years agoMerge branch '3219-further-docker-improvements'
Ward Vandewege [Thu, 10 Jul 2014 15:12:42 +0000 (11:12 -0400)]
Merge branch '3219-further-docker-improvements'

refs #3219

10 years agoBe consistent about the version of ruby that is installed by rvm and
Ward Vandewege [Thu, 10 Jul 2014 15:07:56 +0000 (11:07 -0400)]
Be consistent about the version of ruby that is installed by rvm and
used by the various containers. Be consistent about using rvm-exec and
bundle exec in every command that uses ruby.

Add documentation and warning about --realclean option to build.sh

refs #3219

10 years agoWhitespace fix.
Ward Vandewege [Thu, 10 Jul 2014 14:35:04 +0000 (10:35 -0400)]
Whitespace fix.

refs #3219

10 years agoAnother tweak to tutorial-job-debug.html.textile.liquid
Ward Vandewege [Wed, 9 Jul 2014 18:41:18 +0000 (14:41 -0400)]
Another tweak to tutorial-job-debug.html.textile.liquid

no issue #

10 years agoBe more explicit that hello-world.py is a script which is expected to fail.
Ward Vandewege [Wed, 9 Jul 2014 18:33:52 +0000 (14:33 -0400)]
Be more explicit that hello-world.py is a script which is expected to fail.

no issue #

10 years agoImprove arv-run-pipeline-instance's logging when it encounters an error.
Ward Vandewege [Wed, 9 Jul 2014 17:30:29 +0000 (13:30 -0400)]
Improve arv-run-pipeline-instance's logging when it encounters an error.

no issue #

10 years agoGive API server arv-run-pipeline-instance bugfix.
Brett Smith [Wed, 9 Jul 2014 15:18:26 +0000 (11:18 -0400)]
Give API server arv-run-pipeline-instance bugfix.

This commit ensures that crunch-dispatch gets the bugfix in b5b0f8c9.
No issue #.

10 years ago3106: show the spinner in the middle of the popup header
radhika [Wed, 9 Jul 2014 15:16:55 +0000 (11:16 -0400)]
3106: show the spinner in the middle of the popup header

10 years agoMerge branch 'master' into 3106-modal-loading-indicator
radhika [Wed, 9 Jul 2014 14:20:00 +0000 (10:20 -0400)]
Merge branch 'master' into 3106-modal-loading-indicator

10 years ago3201: Simplify logic to decide "My Projects" is selectable.
Brett Smith [Wed, 9 Jul 2014 01:32:40 +0000 (21:32 -0400)]
3201: Simplify logic to decide "My Projects" is selectable.

Thinking about it on the commute home, I decided that my previous
implementation that inspected action_href (e007ef71) was too clever by
half.  Following the adage that explicit is better than implicit, this
version provides a knob you can turn to just say whether or not "My
Projects" is selectable.

Closes #3201.

10 years agocloses #3203
radhika [Wed, 9 Jul 2014 00:34:22 +0000 (20:34 -0400)]
closes #3203
Merge branch '3203-workbench-tutorial'

10 years agoMerge branch 'master' into 3203-workbench-tutorial
radhika [Wed, 9 Jul 2014 00:23:02 +0000 (20:23 -0400)]
Merge branch 'master' into 3203-workbench-tutorial

10 years ago3201: Only Projects can be moved to "My Projects."
Brett Smith [Tue, 8 Jul 2014 22:06:45 +0000 (18:06 -0400)]
3201: Only Projects can be moved to "My Projects."

Before this commit, it was possible to move any object that goes in
folders to "My Projects."  If you did, it would be removed from any
project, and owned by the user directly.  This is non-obvious.  Data
should be removed from projects by using the trash icon on the project
page instead.

Closes #3201.

10 years agoarv-run-pipeline-instance doesn't submit nil Job parameters.
Brett Smith [Tue, 8 Jul 2014 20:46:29 +0000 (16:46 -0400)]
arv-run-pipeline-instance doesn't submit nil Job parameters.

This is the same principle that we already take with POST parameters,
applied to the body of the Job itself.  It immediately prevents
sending nil runtime_constraints, which the API server doesn't accept.
It should also mean that any error messages passed on from the API
server are more likely to be helpful.

No issue # - reported by Abram on IRC.

10 years agoMerge branch 'master' into 3203-workbench-tutorial
radhika [Tue, 8 Jul 2014 20:34:56 +0000 (16:34 -0400)]
Merge branch 'master' into 3203-workbench-tutorial

10 years ago3203: fix doc issues with old dashboard references.
radhika [Tue, 8 Jul 2014 20:34:07 +0000 (16:34 -0400)]
3203: fix doc issues with old dashboard references.

10 years agoStart API pipeline integration test.
Brett Smith [Tue, 8 Jul 2014 20:00:08 +0000 (16:00 -0400)]
Start API pipeline integration test.

No issue #.  I wrote this while debugging the issue in the previous
commit.

10 years ago3203: fix doc issues with compute references.
radhika [Tue, 8 Jul 2014 19:59:59 +0000 (15:59 -0400)]
3203: fix doc issues with compute references.

10 years ago3209: arv-run-pipeline-instance sends instance body as JSON.
Brett Smith [Tue, 8 Jul 2014 19:59:39 +0000 (15:59 -0400)]
3209: arv-run-pipeline-instance sends instance body as JSON.

If we don't encode the body as JSON ourselves, the API client library
will omit empty attributes.  This can cause required component
attributes like script_parameters to be lost, so we need to circumvent
that behavior.  It also seems safe, since we already do the same
encoding in the update method.  Closes #3209.

10 years agoMerge branch 'resumable-output-upload'. Adds signal handling and error recovery
Peter Amstutz [Tue, 8 Jul 2014 18:57:14 +0000 (14:57 -0400)]
Merge branch 'resumable-output-upload'. Adds signal handling and error recovery
when uploading job output to run-command wrapper.  refs #2342

10 years agoActually use the resume cache
Peter Amstutz [Tue, 8 Jul 2014 18:51:18 +0000 (14:51 -0400)]
Actually use the resume cache

10 years agoMerge branch 'master' into 3203-workbench-tutorial
radhika [Tue, 8 Jul 2014 18:44:04 +0000 (14:44 -0400)]
Merge branch 'master' into 3203-workbench-tutorial

10 years ago3203: Update the pipeline tutorial page to run pipeline from a project.
radhika [Tue, 8 Jul 2014 18:42:26 +0000 (14:42 -0400)]
3203: Update the pipeline tutorial page to run pipeline from a project.

10 years agoTurns out sys.exit runs finally: blocks.
Peter Amstutz [Tue, 8 Jul 2014 18:29:29 +0000 (14:29 -0400)]
Turns out sys.exit runs finally: blocks.

10 years agoAdd debugging
Peter Amstutz [Tue, 8 Jul 2014 18:24:32 +0000 (14:24 -0400)]
Add debugging

10 years agoWrong num args
Peter Amstutz [Tue, 8 Jul 2014 18:21:05 +0000 (14:21 -0400)]
Wrong num args

10 years agoSigHandler object
Peter Amstutz [Tue, 8 Jul 2014 18:19:45 +0000 (14:19 -0400)]
SigHandler object

10 years agoStill messing with signals.
Peter Amstutz [Tue, 8 Jul 2014 18:16:21 +0000 (14:16 -0400)]
Still messing with signals.

10 years agoFix wrong number of parameters
Peter Amstutz [Tue, 8 Jul 2014 18:08:28 +0000 (14:08 -0400)]
Fix wrong number of parameters

10 years agoRecord signals a different way
Peter Amstutz [Tue, 8 Jul 2014 18:06:15 +0000 (14:06 -0400)]
Record signals a different way

10 years agoMore work on signal handling
Peter Amstutz [Tue, 8 Jul 2014 18:02:26 +0000 (14:02 -0400)]
More work on signal handling

10 years agoForward signals to process.
Peter Amstutz [Tue, 8 Jul 2014 17:50:58 +0000 (13:50 -0400)]
Forward signals to process.

10 years ago3203: Update "Accessing Arvados Workbench" page.
radhika [Tue, 8 Jul 2014 17:29:55 +0000 (13:29 -0400)]
3203: Update "Accessing Arvados Workbench" page.

10 years agorefs #2380 Needed to updated all docs referencing to SSH documentation.
radhika [Tue, 8 Jul 2014 15:27:55 +0000 (11:27 -0400)]
refs #2380 Needed to updated all docs referencing to SSH documentation.
Merge branch '2380-ssh-doc'

10 years ago2380: ssh doc references are updated to point to the right env.
radhika [Tue, 8 Jul 2014 15:24:12 +0000 (11:24 -0400)]
2380: ssh doc references are updated to point to the right env.

10 years agoUse resumable upload writing output in run-command
Peter Amstutz [Tue, 8 Jul 2014 15:12:40 +0000 (11:12 -0400)]
Use resumable upload writing output in run-command

10 years agocloses #2380
radhika [Tue, 8 Jul 2014 14:15:26 +0000 (10:15 -0400)]
closes #2380
Merge branch '2380-ssh-doc'

10 years agoMerge branch 'master' into 2380-ssh-doc
radhika [Tue, 8 Jul 2014 14:14:44 +0000 (10:14 -0400)]
Merge branch 'master' into 2380-ssh-doc

10 years agoMerge branch '3206-keepproxy-use-client-token' closes #3206
Peter Amstutz [Tue, 8 Jul 2014 14:08:26 +0000 (10:08 -0400)]
Merge branch '3206-keepproxy-use-client-token' closes #3206

10 years agoMerge branch '3078-arv-put-name-links'
Brett Smith [Tue, 8 Jul 2014 13:55:23 +0000 (09:55 -0400)]
Merge branch '3078-arv-put-name-links'

Closes #3078, #3176, #3205.

10 years ago3176: Fix arv-put's resume cache writing.
Brett Smith [Mon, 7 Jul 2014 21:52:31 +0000 (17:52 -0400)]
3176: Fix arv-put's resume cache writing.

Refactoring directory creation into _util accidentally broke this:
arv-put was trying to save the cache to a relatively directory that
almost never existed, and then silently ignored the error.

10 years ago3078: Add arv-put options to add the upload to a Project.
Brett Smith [Mon, 7 Jul 2014 20:48:50 +0000 (16:48 -0400)]
3078: Add arv-put options to add the upload to a Project.

10 years ago3078: arv-put supports dynamic stderr.
Brett Smith [Mon, 7 Jul 2014 18:29:39 +0000 (14:29 -0400)]
3078: arv-put supports dynamic stderr.

10 years ago3078: arv-put always writes progress before starting work.
Brett Smith [Mon, 7 Jul 2014 17:10:42 +0000 (13:10 -0400)]
3078: arv-put always writes progress before starting work.

It previously did this when resuming, but there's no reason we
shouldn't do it when starting fresh as well.

10 years agoMerge branch 'master' into 2380-ssh-doc
radhika [Tue, 8 Jul 2014 13:40:55 +0000 (09:40 -0400)]
Merge branch 'master' into 2380-ssh-doc

10 years ago2380: update the add key image and text
radhika [Tue, 8 Jul 2014 13:40:27 +0000 (09:40 -0400)]
2380: update the add key image and text

10 years agoKeepproxy use client-supplied token when forwarding GET and PUT requests.
Peter Amstutz [Tue, 8 Jul 2014 13:18:07 +0000 (09:18 -0400)]
Keepproxy use client-supplied token when forwarding GET and PUT requests.

10 years ago2380: more updates
radhika [Tue, 8 Jul 2014 13:09:02 +0000 (09:09 -0400)]
2380: more updates

10 years ago2380: Extract common documentation items from Unix and Windows environments into...
radhika [Tue, 8 Jul 2014 12:51:30 +0000 (08:51 -0400)]
2380: Extract common documentation items from Unix and Windows environments into include files.

10 years agomissing paren typo in arvados-bcbio-nextgen.py. refs #2991
Peter Amstutz [Tue, 8 Jul 2014 12:47:59 +0000 (08:47 -0400)]
missing paren typo in arvados-bcbio-nextgen.py.  refs #2991

10 years agobc-bio script links gemini reference data. refs #2991
Peter Amstutz [Tue, 8 Jul 2014 02:45:29 +0000 (22:45 -0400)]
bc-bio script links gemini reference data.  refs #2991

10 years ago3204: Remove redundant pull-right from Workbench Collections search.
Brett Smith [Tue, 8 Jul 2014 02:48:28 +0000 (22:48 -0400)]
3204: Remove redundant pull-right from Workbench Collections search.

content_for :tab_line_buttons is already wrapped in a div.pull-right.
Doing that a second time forces the contents into an overly-small
box.

Closes #3204.

10 years agorefs #3140
radhika [Tue, 8 Jul 2014 00:53:36 +0000 (20:53 -0400)]
refs #3140
Revert back the UI to display only one tab instead of 5 content tabs since it is not working when accessing a project with large amounts of data.
Merge branch '3140-undo-project-content-tabs'

10 years ago3140: revert multiple content tabs work
radhika [Tue, 8 Jul 2014 00:44:36 +0000 (20:44 -0400)]
3140: revert multiple content tabs work

10 years agoadd 'import sys' to arvados-bcbio-nextgen. no issue #
Peter Amstutz [Mon, 7 Jul 2014 21:00:34 +0000 (17:00 -0400)]
add 'import sys' to arvados-bcbio-nextgen.  no issue #

10 years agoDon't use "arv" command wrapper, call arv-get/arv-put directly. Avoids
Peter Amstutz [Mon, 7 Jul 2014 20:54:17 +0000 (16:54 -0400)]
Don't use "arv" command wrapper, call arv-get/arv-put directly.  Avoids
dependency on arvados-cli gem being properly configured on compute node.
no issue #

10 years ago2380: one more update
radhika [Mon, 7 Jul 2014 20:39:15 +0000 (16:39 -0400)]
2380: one more update

10 years agoUpdate arvados-cli dependency to correct deployed version. no issue #
Peter Amstutz [Mon, 7 Jul 2014 20:34:14 +0000 (16:34 -0400)]
Update arvados-cli dependency to correct deployed version. no issue #

10 years agoMerge branch '3123-pipeline-report-job-submit-errors' closes #3123
Peter Amstutz [Mon, 7 Jul 2014 20:24:47 +0000 (16:24 -0400)]
Merge branch '3123-pipeline-report-job-submit-errors' closes #3123

10 years agoGoogle API client jsonifies the body, so we don't have to.
Peter Amstutz [Mon, 7 Jul 2014 20:24:04 +0000 (16:24 -0400)]
Google API client jsonifies the body, so we don't have to.

10 years ago2380: rename ssh-access.html.textile.liquid as ssh-access-unix.html.textile.liquid
radhika [Mon, 7 Jul 2014 20:22:12 +0000 (16:22 -0400)]
2380: rename ssh-access.html.textile.liquid as ssh-access-unix.html.textile.liquid

10 years ago2380: minor updates
radhika [Mon, 7 Jul 2014 20:11:08 +0000 (16:11 -0400)]
2380: minor updates

10 years agoUpdate package version dependencies on arvados-cli to use commit:7bd2ee2
Peter Amstutz [Mon, 7 Jul 2014 19:48:12 +0000 (15:48 -0400)]
Update package version dependencies on arvados-cli to use commit:7bd2ee2

10 years ago2380: more updates and also correct the link to unix page from within the windows...
radhika [Mon, 7 Jul 2014 19:47:41 +0000 (15:47 -0400)]
2380: more updates and also correct the link to unix page from within the windows page

10 years agoarv-run-pipeline-instance sends error message to logs table when job submission
Peter Amstutz [Mon, 7 Jul 2014 19:45:24 +0000 (15:45 -0400)]
arv-run-pipeline-instance sends error message to logs table when job submission
fails.  Pipeline instance view in workbench now shows messages for the pipeline
instance (in addition to the jobs) and shows messages when the pipeline is
failed (not only when it is running.)

10 years agoMerge branch 'master' into 2380-ssh-doc
radhika [Mon, 7 Jul 2014 19:33:30 +0000 (15:33 -0400)]
Merge branch 'master' into 2380-ssh-doc

10 years agocloses #3140
radhika [Mon, 7 Jul 2014 19:01:29 +0000 (15:01 -0400)]
closes #3140
Merge branch '3140-project-content-tabs'

10 years agocrunch-dispatch: make sure to update the info['slurm_state'] for the
Ward Vandewege [Mon, 7 Jul 2014 19:04:52 +0000 (15:04 -0400)]
crunch-dispatch: make sure to update the info['slurm_state'] for the
correct node, not just the first one that happens to have a matching
hostname in our database.

no issue #

10 years agoMerge branch 'master' into 3140-project-content-tabs
radhika [Mon, 7 Jul 2014 19:00:25 +0000 (15:00 -0400)]
Merge branch 'master' into 3140-project-content-tabs

10 years agoMerge branch 'master' into 3140-project-content-tabs
radhika [Mon, 7 Jul 2014 18:58:01 +0000 (14:58 -0400)]
Merge branch 'master' into 3140-project-content-tabs

10 years agoMerge branch 'master' into 2380-ssh-doc
radhika [Mon, 7 Jul 2014 18:51:29 +0000 (14:51 -0400)]
Merge branch 'master' into 2380-ssh-doc

10 years ago2380: more doc updates
radhika [Mon, 7 Jul 2014 18:51:00 +0000 (14:51 -0400)]
2380: more doc updates

10 years ago2380: minor doc updates
radhika [Mon, 7 Jul 2014 18:36:25 +0000 (14:36 -0400)]
2380: minor doc updates

10 years agoDon't render selection check boxes when using show_file partials from chooser
Peter Amstutz [Mon, 7 Jul 2014 18:22:48 +0000 (14:22 -0400)]
Don't render selection check boxes when using show_file partials from chooser
modal.  closes #3103.

10 years ago2380: minor doc updates
radhika [Mon, 7 Jul 2014 18:13:25 +0000 (14:13 -0400)]
2380: minor doc updates

10 years agoConsider script_parameters in determining whether to merge script boxes in
Peter Amstutz [Mon, 7 Jul 2014 18:09:20 +0000 (14:09 -0400)]
Consider script_parameters in determining whether to merge script boxes in
pipeline graph drawing.  Also tweaks behavior generating label for
script_parameter boxes to be more compact.  closes #3100

10 years ago2380: ssh to SSH where applicable
radhika [Mon, 7 Jul 2014 17:59:34 +0000 (13:59 -0400)]
2380: ssh to SSH where applicable

10 years agoMerge branch 'master' into 2380-ssh-doc
radhika [Mon, 7 Jul 2014 17:46:12 +0000 (13:46 -0400)]
Merge branch 'master' into 2380-ssh-doc

10 years agoMerge branch 'master' into 3106-modal-loading-indicator
radhika [Mon, 7 Jul 2014 17:44:35 +0000 (13:44 -0400)]
Merge branch 'master' into 3106-modal-loading-indicator

10 years ago3106: spinner to the left to avoid shifting down elements when it is visible
radhika [Mon, 7 Jul 2014 17:43:41 +0000 (13:43 -0400)]
3106: spinner to the left to avoid shifting down elements when it is visible

10 years agoDefault arvados-bcbio-nextgen pipeline to use freebayes instead of gatk. no issue #
Peter Amstutz [Mon, 7 Jul 2014 17:03:01 +0000 (13:03 -0400)]
Default arvados-bcbio-nextgen pipeline to use freebayes instead of gatk.  no issue #

10 years agoMerge branch 'master' into 3106-modal-loading-indicator
radhika [Mon, 7 Jul 2014 16:40:56 +0000 (12:40 -0400)]
Merge branch 'master' into 3106-modal-loading-indicator

10 years agoarvados-bcbio-nextgen writes output now. Put write_directory_tree under the
Peter Amstutz [Mon, 7 Jul 2014 15:46:56 +0000 (11:46 -0400)]
arvados-bcbio-nextgen writes output now.  Put write_directory_tree under the
try/except block in run-command.  Tweaked return code output.  no issue #

10 years agoBugfix os.environ() -> os.environ[] no issue #
Peter Amstutz [Mon, 7 Jul 2014 15:26:24 +0000 (11:26 -0400)]
Bugfix os.environ() -> os.environ[] no issue #

10 years agoMerge branch 'bcbio-nextgen' refs #2991
Peter Amstutz [Mon, 7 Jul 2014 13:46:11 +0000 (09:46 -0400)]
Merge branch 'bcbio-nextgen' refs #2991

10 years agoAdd -n cores to run bcbio in parallel on a multicore node.
Peter Amstutz [Mon, 7 Jul 2014 13:45:16 +0000 (09:45 -0400)]
Add -n cores to run bcbio in parallel on a multicore node.

10 years agoAdd $(node.cores) substitution to run-program, and add CRUNCH_NODE_SLOTS to
Peter Amstutz [Mon, 7 Jul 2014 13:32:33 +0000 (09:32 -0400)]
Add $(node.cores) substitution to run-program, and add CRUNCH_NODE_SLOTS to
environment passed to docker jobs. no issue #

10 years agorun-command retry after exception when writing output to keep. no issue #
Peter Amstutz [Mon, 7 Jul 2014 12:59:24 +0000 (08:59 -0400)]
run-command retry after exception when writing output to keep.  no issue #

10 years agoDoc: fix link to pipeline instances page in workbench.
Ward Vandewege [Mon, 7 Jul 2014 00:06:16 +0000 (20:06 -0400)]
Doc: fix link to pipeline instances page in workbench.

no issue #

10 years agoMerge branch '3185-job-invalid-without-errors' refs #3185
Peter Amstutz [Fri, 4 Jul 2014 21:08:39 +0000 (17:08 -0400)]
Merge branch '3185-job-invalid-without-errors' refs #3185

10 years ago3185: Fix job validation failure with no errors given.
Tom Clegg [Fri, 4 Jul 2014 17:01:28 +0000 (13:01 -0400)]
3185: Fix job validation failure with no errors given.

* Do not fail docker validation if runtime_constraints==nil.

* Reposition "check docker image" and "check script version" as
  validations, rather than before_validation and before_create/update
  filters respectively.

* Use valid values for the non-docker attributes in docker test cases.

* Add tests to ensure job validation failures provide error messages.

Move test/functional/arvados/v1/git_setup.rb to
test/helpers/git_test_helper.rb and fix bugs:

* Use "setup do" form instead of "def setup" to avoid clobbering other
  setup tasks

* Restore git_repositories_dir to its original value during teardown,
  to avoid polluting other tests

10 years agoUpdate api server Gemfile dependency on arvados-cli package so crunch-dispatch
Peter Amstutz [Fri, 4 Jul 2014 03:21:21 +0000 (23:21 -0400)]
Update api server Gemfile dependency on arvados-cli package so crunch-dispatch
uses commit:b7de0ac no issue #

10 years agoMerge branch '2991-job-docker-images' refs #2991
Peter Amstutz [Fri, 4 Jul 2014 02:54:21 +0000 (22:54 -0400)]
Merge branch '2991-job-docker-images' refs #2991

10 years agoMerge branch '2342-run-command-wrapper' refs #2342
Peter Amstutz [Fri, 4 Jul 2014 02:51:59 +0000 (22:51 -0400)]
Merge branch '2342-run-command-wrapper' refs #2342

10 years agoMerge branch '3141-keep-logging-improvements'
Ward Vandewege [Fri, 4 Jul 2014 02:30:44 +0000 (22:30 -0400)]
Merge branch '3141-keep-logging-improvements'

This closes #3141

10 years agokeep: MockVolume should return os.ErrNotExist instead of errors.New("not
Ward Vandewege [Fri, 4 Jul 2014 02:29:18 +0000 (22:29 -0400)]
keep: MockVolume should return os.ErrNotExist instead of errors.New("not
found") when a block can not be found, just like a real volume.

10 years agoRevert "Do not print an error when hitting 'not found' with a the MockVolume"
Ward Vandewege [Fri, 4 Jul 2014 02:28:45 +0000 (22:28 -0400)]
Revert "Do not print an error when hitting 'not found' with a the MockVolume"

This reverts commit 97c9b2b49f94735c6d4d5b62b772089ef7e0e3bf.

Better solution in the next commit.