Progress Bar Implementation for CodeGen in Theia - xtext

on clicking generate java code button in theia editor
it’s calling registry command in command contribution in theia.
registry command is hitting IExecutableCommandService in backend LSP to generate java code.
now i need value of execution progress in theia editor so that i can implement that in progress bar.

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.

Google Cloud Platform - Viewing downloaded files after wget

I am completing this tutorial and am at the part where you download the code for the tutorial. The request we send to Github is:
wget https://github.com/GoogleCloudPlatform/cloudml-samples/archive/master.zip
I understand that this downloads archive to GCP, and I can see the files in the Cloud shell, but is there a way to see the files through the Google Console GUI? I would like to browse the files I have downloaded to understand their structure better.
By clicking on the pencil icon on the top right corner, the Cloud Shell Code editor will pop.
Quoting the documentation:
"The built-in code editor is based on Orion. You can use the code
editor to browse file directories as well as view and edit files, with
continued access to the Cloud Shell. The code editor is available by
default with every Cloud Shell instance."
You can find more info here: https://cloud.google.com/shell/docs/features#code_editor
If you prefer to use the command line to view files, you can install and run the tree Unix CLI command 1 and run it in Cloud Shell to list contents of directories in a tree-like format.
install tree => $ sudo apt-get install tree
run it => $ tree ./ -h --filelimit 4
-h will show human readable size of files/directories
and you can use --filelimit to set the maximum number of directories to descent within the list.
Use $ man tree to see the available parameters for the command, or check the man online documentation here: https://linux.die.net/man/1/tree

VS 2013 Release Management - Illegal characters in path

I have build a custom deployment Action based on TFS 2010 command-line utility, TF.exe. When executed from a DOS prompt on the deployment agent server, it runs fine.
TF view /collection:uri "$source path" > "local path"
and the file does get downloaded, without a need of a workspace. However, when executed through VS2013RM, I get an error:
Illegal characters in path.
When I hover over the message column it reads:
The installation command \"my correct command line here\" failed with the exit code \"100\"
What gives? How come it executes fine in one place, but not the other? The RM Client runs under a network service account, which is part of the local admins and collection's service accounts.
After enabling log
I was able to capture this command:
Deployment: **********Installing component using command "C:\DevOps\TfsClient\TF.exe view /collection:http://[removed detail] "$/[removed detail]/MetastoreCS.xml" > "F:\[removed detail]\MetastoreCS.xml""
Than the error
9/24/2014 10:58:10 AM - Information - (12628, 26560) - Deployment: Exception The installation command \"C:\DevOps\TfsClient\TF.exe view /collection:http://[removed detail] "$/[removed detail]/MetastoreCS.xml" > "F:\[removed detail]\MetastoreCS.xml"\" failed with the exit code \"100\".
It seems like the redirecting character '>' is causing issue.
I was able to make it work using the /output option. Refer to the tf view documentation.
C:\DevOps\TfsClient\TF.exe view /collection:http://[removed detail] "$/[removed detail]/MetastoreCS.xml" /output:"F:\[removed detail]\MetastoreCS.xml"

Problems with Cloud SDK

So I am a complete noob and have no idea how to even navigate these forum as it all sound like a foreign language. My issue is I recent was accepted to use Google page speed service and cannot even get the first step out of the way which is installing Cloud SDK.
Here is step by step what I did:
Extracted all from zip file
Clicked to launch the Batched file (upon clicking the command prompt black screen flashed in the corner, no instructions or anything else)
When attempting to authenticate google cloud platform by clicking windows key + r. THen typing in 'gcloud auth login', I get a message that says, "cannot find 'gcloud'.....".
When you run install.bat, this is an interactive process that should not exit immediately. I'm guessing you don't have Python installed? Install Python 2.7 and try again.
After the installer runs, it will print directions on how to add gcloud to your PATH. In general, though, gcloud is a command line tool that you shouldn't really run using windows+r. It's best to open a cmd prompt so you can more easily run multiple commands.

Resources