ToolTwist Controller hangs while generating images - imagemagick

While generating a large site using the ToolTwist Controller, the server hangs. Using ps -ef I can see that there is an ImageMagick 'convert' command that never seems to finish. If I kill the convert process, the generate continues.
If I get the full convert command from the log file or using ps, I can run it from the command line with no problem. Each time I run the generate process in the Controller it gets stuck in a different place.
How often it hangs seems to be sporadic, and only occurs maybe every 1,000 images.
I'm running OSX 10.7.3 on a Macbook Pro.

This is a known bug in ImageMagick - see http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=19962
The solution is to define an environment variable:
export MAGICK_THREAD_LIMIT=1
You'll need to do this before starting the Controller's tomcat server.

Related

My docker container keeps instantly closing when trying to run an image for bigcode-tools

I'm new to Docker, and I'm not sure how to quite deal with this situation.
So I'm trying to run a docker container in order to replicate some results from a research paper, specifically from here: https://github.com/danhper/bigcode-tools/blob/master/doc/tutorial.md
(image link: https://hub.docker.com/r/tuvistavie/bigcode-tools/).
I'm using a windows machine, and every time I try to run the docker image (via: docker run -p 80:80 tuvistavie/bigcode-tools), it instantly closes. I've tried running other images, such as the getting-started, but that image doesn't close instantly.
I've looked at some other potential workarounds, like using -dit, but since the instructions require setting an alias/doskey for a docker run command, using the alias and chaining it with other commands multiple times results in creating a queue for the docker container since the port is tied to the alias.
Like in the instructions from the GitHub link, I'm trying to set an alias/doskey to make api calls to pull data, but I am unable to get any data nor am I getting any errors when performing the calls on the command prompt.
Sorry for the long question, and thank you for your time!
Going in order of the instructions:
0. I can run this, it added the image to my Docker Desktop
1.
Since I'm using a windows machine, I had to use 'set' instead of 'export'
I'm not exactly sure what the $ is meant for in UNIX, and whether or not it has significant meaning, but from my understanding, the whole purpose is to create a directory named 'bigcode-workspace'
Instead of 'alias,' I needed to use doskey.
Since -dit prevented my image from instantly closing, I added that in as well, but I'm not 100% sure what it means. Running docker run (...) resulted in the docker image instantly closing.
When it came to using the doskey alias + another command, I've tried:
(doskey macro) (another command)
(doskey macro) ^& (another command)
(doskey macro) $T (another command)
This also seemed to be using github api call, so I also added a --token=(github_token), but that didn't change anything either
Because the later steps require expected data pulled from here, I am unable to progress any further.
Looks like this image is designed to be used as a command-line utility. So it should not be running continuously, but you run it via alias docker-bigcode for your tasks.
$BIGCODE_WORKSPACE is an environment variable expansion here. So on a Windows machine it's %BIGCODE_WORKSPACE%. You might want to set this variable in Settings->System->About->Advanced System Settings, because variables set with SET command will apply to the current command prompt session only. Or you can specify the path directly, without environment variable.
As for alias then I would just create a batch file with the following content:
docker run -p 6006:6006 -v %BIGCODE_WORKSPACE%:/bigcode-tools/workspace tuvistavie/bigcode-tools %*
This will run the specified command appending the batch file parameters at the end. You might need to add double quotes if BIGCODE_WORKSPACE path contains spaces.

running pycharm interpreter using nvidia-docker2

Im working on Ubuntu 20. I've installed docker, nvidia-docker2. On Pycharm, I've followed jetbrain guide, but in the advanced steps it isn't consistent with what I see in my setup. I use PyCharm Proffesional 2022.2.
In this step:
in the run options I put additionally --runtime=nvidia and --gpus=all.
Step 4 finishes as same as in the guide (almost, but it seems that it doesn't bother anything so on that later) and on step 5 I put manually the path to the interpreter in the virtual environment I've created using the Dockerfile.
In that way I am able to run the command of nvidia-smi and see correctly the GPU, but I don't see any packages I've installed during the Dockerfile build.
There is another option to connect the interpreter a little bit differently in which I do see the packages, but I can't run the nvidia-smi command and the torch.cuda.is_availble return False.
The way is instead of doing this as in the guide:
I press on the little down arrow in left of the Add Interpreter button and then click on Show all:
After which I can press the + button :
works, so it might be PyCharm "Python Console" issue.
and then I can choose Docker:
which will result in the difference mentioned above in functionality and also in the path dispalyed (the first one is the first remote interpreter top to bottom direction and the second is the second correspondingly):
Here of course the effect of the first and the second correspondingly:
Here is the results of the interpreter run with the first method connected interpreter:
and here is the second:
Of the following code:
Here is the Dockerfile file if you want to take a look:
Anyone configured it correctly and can help ?
Thank you in advance.
P.S: if I run the docker from services and enter the terminal the command nvidia-smi works fine and also the import of torch and the command torch.cuda.is_available return True.
P.S.2:
The thing that has worked for me for now is to change the Dockerfile to install directly torch with pip without create conda environement.
Then I set the path to the python2.7 and I can run the code, but not debug it.
for run the result is as expected (the packages list as was shown before is still empty, but it works, I guess somehow my IDE cannot access the packages list of the remote interpreter in that case, I dont know why):
But the debugger outputs the following error:
Any suggestions for the debugger issue also will be welcome, although it is a different issue.
Please update to 2022.2.1 as it looks like a known regression that has been fixed.
Let me know if it still does not work well.

Chef stuck at "Recipe: java::openjdk"

I'm currently using knife zero to help me provision the servers and the commands are executed through Jenkins.
But recently I noticed that the process will stuck halfway through without any error and it is always at the part where it start executing the Java recipe.
So every time the process got stuck, I will have to reboot my system to get it running again.
The Java cookbook i'm using is from Chef supermarket.
https://supermarket.chef.io/cookbooks/java/versions/1.50.0
How should I debug this issue?
I would agree with #coderanger that this sounds like a symptom of a process that is waiting for user input before it can continue. Is it possible that you're trying to install Java 7 and haven't included the attribute accept_oracle_download_terms?
From the docs for that cookbook, this is explicitly noted as being required:
To install Oracle Java 7 (note that when installing Oracle JDK,
accept_oracle_download_terms attribute must be set
After much investigation, I found out that this is due to the lack of available ram in the system when chef is running.
I use the sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches' command to clear up the caches at the start of each run and my script no longer get stuck anymore.
http://linuxinsight.com/proc_sys_vm_drop_caches.html

Terminal not responding in Cloud9 IDE Rails

I'm working my way through the Ruby on Rails Tutorial, and suddenly the terminal is not responding to common commands.
Entering commands like "bundle exec rake test" or "rails console" creates the situation in the screenshot below and waiting hours does not change anything.
http://i59.tinypic.com/2poz5ah.png
I can type on the line but the Terminal still doesn't respond to any commands here. Ctrl+C allows me to escape the previous request and get back to the command line.
Strangely, "git status" works fine and quick.
Any ideas how to fix this?
I've tried restarting the Terminal and re-loading the workspace.
I just ran into the same problem two times (also going thru the Rails Tutorial) and here's how I went about adressing it:
Click on the workspace button in the top right corner- that's where it shows your CPU, Memory & Disk Usage (if you're on a laptop/small screen zoom out or make the screen as wide as possible to view that).
Next click on the "show process" button to see active processes.
After that I "force killed" my bash and ruby processes.
Lastly I clicked the "restart" button, which you see that when you first clicked to see the workspace info. Please note that if I went first to clicking this "restart" it had no effect... I had to force kill... THEN resart...
Viola, two times now it worked!
Not sure if this has any impact, but both times I mentally retraced my steps and realized I had several terminal windows open and willy-nilly ran the console multiple times in different terminal windows over the course of a few days. I would then run into not being able to run rails c UNLESS I have previously "properly" exited an already running console (meaning ctrl-c).
I've run into something similar while running Rails on my machine, and a full system restart does the trick. Perhaps due to the cloud based nature of Rails on Cloud9 there is some "sticky" process that stays on?
EDIT: Forgot to mention that on my machine I would also run "killall ruby" in a new terminal window. While that didn't work on Cloud9 it may be worth a try!
Anyhoo- lemme know if that does the trick!
Please do report these kind of (performance) questions to our Support desk via https://support.c9.io - we'll be able to help you quickly! Thanks.
what I did is just killed that process
ubuntu 5318 0.0 0.0 488820 16872 pts/3 Sl Dec24 0:01 spring server
kill -9 5318
You will have ur pid number. so just use it.
to get process -- use :
ps aux
Executing "bin/spring stop" would solve the issue as well. It is currently unknown why this happens and we are looking into that.

IntelliJ 11 hangs when executing grails command

I am using IntelliJ 11 with Grails 2.0.0 under Ubuntu. When IntelliJ executes any grails command it hangs straight away. I am not able to migrate my project to 2.0.0 (from 1.3.7) or even create a new grails project.
No exceptions thrown in the logs, hangs after clicking on create-app using grails.
Anyone have an idea what could be the problem here?
Thanks,
For me, the freeze only occurs when starting idea from a terminal window using & (ampersand for running in background, like this:
/path/to/your/ideahome/bin/idea.sh &
IDEA then starts correctly, but as soon as any grails command is run, the process enters "stopped" state and the IDEA GUI appears to be frozen.
When doing "fg" on the process, the application wakes up again and actually runs the grails command.
So, the workaround is of course to not run IDEA in background, for example by creating a desktop icon using the following as the "command":
bash -c "export JAVA_HOME=/path/to/your/javahome;/path/to/your/ideahome/bin/idea.sh"
I have found the following to 'unstick' the process though not every time.
when Intellij hangs due to some grails command or another, I run the following to see which processes are running (I have an alias set with the name 'idea' you would use whatever the command is to run idea)
ps -ef | grep idea
There are usually 3 or 4 processes, but the first one looks like:
username 19349 14977 0 10:41 pts/1 00:00:00 /bin/sh /usr/local/bin/idea
I run the following command to kill it
kill -9 {processId}
For example:
kill -9 19349
We use -9 to force full kill the process.
Intellij begins processing as normal. Sometimes I get the prompt about whether I am sure I want to exit to which I reply no.
Sometimes it does not work and I have to kill intelliJ entirely then start over. Most times it works.
Try 11.0.2 RC from http://confluence.jetbrains.net/display/IDEADEV/IDEA+11+EAP. If it doesn't help, file a bug at http://youtrack.jetbrains.net/issues/IDEA with a thread dump attached, refer to http://www.jetbrains.net/devnet/docs/DOC-260 for details.

Resources