GraalVM native-image: Is it possible to start a Gradle daemon? - gradle

I want to build a GraalVM native image (CLI app) that uses/calls the Gradle Tooling API.
In order to do that, a Gradle daemon must exist. So far it seems as though a native image cannot start a Gradle daemon. I suspect it is due to reflection and/or a lot of classes (like, a lot!) that I'm not providing to the config of native image.
Does anybody know if it's even remotely possible to do this? If so, how? Note, that it is important to me that the native image is able to create the daemon directly, if possible.
So far, I've resorted to "delegate" the Gradle Tooling API (and daemon creation) parts of the CLI app to a sub-process that is started by the native image, and the sub-process handles the API calls and feeds the IO back to the native image using inheritIO(). So I've resorted to create a native image and a (shadow)Jar, where the native image calls the Jar using the JDK of my choosing.

Related

How can I use Sikuli4Net or SikuliSharp with Visual Studio for Mac to test .NET Core cross platform applications on MacOS?

I have a cross-platform desktop application written in Xamarin.Forms that runs both in Windows and MacOS. I want to do some UI automation on top of that application.
After some research it seems like the most cross-platform friendly option is to use Something like Sikuli. As the default stack on our team is centered on the .NET stack we want to use SikuliSharp or Sikuli4Net to perform the automated UI tests.
However, despite of the fact that we've been able to run Sikuli4Net successfully on Windows, automating several flows so far. We have a dire situation on MacOS. Our team (myself included) doesn't have a lot (or maybe any) knowledge of Java applications.
I've installed the JDK 8, but was unable to run the tests in the same way we did on Windows. The code builds, but it seems like something in the environment is lacking.
With Sikuli4Sharp when starting the APILauncher like this:
launch = new APILauncher(true);
launch.Start();
I get the following error:
With SikuliSharp when trying to run a simple demo application on our software I have this error:
I have tried to set up the SIKULI_HOME environment variable using this answer as a reference, but still the same problem (and I did restart the console and IDE, even my machine).
When I run echo $SIKULI_HOME on the terminal I do get the directory that cointains the .jar files:
So I'm kind of lost about were to go from here. These problems made me unsure about being possible to run Sikuli4Net or SikuliSharp on MacOS environments. Is this the case? If not, what am I doing wrong?
as mentioned in the error message: sikuli-script.jar is missing.
You have to check on what version of Sikuli/SikuliX your SikuliSharp or Sikuli4Net are depending on.
In doubt you have to dive into the sources of those Net packages.

.NET Core Profiling When Running in Docker Container

I am using asp.net core 2.2 and Visual Studio 2019. The containers my application are running on are Debian (one of the official aspnet:2.2 docker images)
So my situation is this. I have an application that consists of 4 microservices running in docker containers and I'm seeing very high cpu usage on the containers nodes when this is under load. What I would like to do is profile the executing code to get an idea where this resource use is happening.
As a starting point I thought I would simply get some profiling running on my local development environment, just to get an idea of what the execution looks like in general. Although in production this runs in Kubernetes I do have a development environment that uses docker compose and I find the Visual Studio Docker tools to be fairly good.
I was hoping to use some of the visual studio profiling tools. I was able to install VSDBG on one of my locally running containers and connect to it with VS BUT in the diagnostic pane I see "the diagnostic tools window does not support the current debugging configuration". I've also tried just running the project from VS using docker compose but I see the same message when I hit a breakpoint. I'm not finding much out there about how to do this.
I also tried getting profiling going using perfcollect but after I generated the trace and opened it with perfviewer I was getting a parsing error when trying to view the cpu stacks . Still not sure what's going on there. I did find an old closed issue on their github describing what I am seeing but there was a fairly recent comment from someone saying they were seeing it with the latest version so maybe it's a regression.
So.. after all this .. my question is this. Are either of the above approaches viable? Is there a better way to achieve this? I'm interested in any way someone has had success viewing some code profiling of a .net core 2.2 application running on a linux docker container. All I really want to do is be able to see where in my code the execution time is going and what resources are being consumed. As I've mentioned I'm not finding much out there when I Google for this and I seem to keep hitting walls. If anyone had any advice or direction on a approach here I would really appreciate it. Thanks much!
Are you open to upgrading to .Net Core 3.0 (.Net Core 2.2 is going out of support in a few days: 12/23/2019)
If you're open to that you can take advantage of the new tool dotnet-trace which supports running in a linux container and can be used with the tools in Visual Studio.
Here are the steps I used to add it to my project:
Change your base image to use the sdk image (needed to install the tool).
Add installing the tool to the image:
RUN dotnet tool install --global dotnet-trace
ENV PATH $PATH:/root/.dotnet/tools
Alternatively if you don’t want to add it in your image you can run the following commands in a running container (as long as it as based on the SDK image):
dotnet tool install --global dotnet-trace
export PATH="$PATH:/root/.dotnet/tools"
Start the project without debugging (Ctrl+F5)
Use the Containers Tool Window to open a terminal window
Run the command:
dotnet-trace collect --process-id $(pidof dotnet) --providers Microsoft-DotNETCore-SampleProfiler
When you are done collecting press enter or Ctrl+C to end the collection
This will crate a file called “trace.nettrace”
By default that /app folder that file would be created in is volume mapped to your project folder. You can open the file from there in VS.

Windows GUI app with Docker Container running Python code in background

I made a Java application in the past for Windows which performs some scientific analysis. This scientific analysis was done by executing a Python script in a Docker container because it required dependencies that were hard to install on Windows.
The GUI application uses Powershell to launch Docker Toolbox in the background which is then used to execute the Python script. My application then waits for the results by checking for the output file's existence.
I was wondering if there was a better way to do this (develop a Windows application that uses Docker containers to run certain code). Any suggestions for technologies that I may consider is appreciated.
TLDR: What's the best way to develop a Windows GUI application that requires some background processing with Docker container?

Has Cordova App on OSX way to run shell command?

I'm trying to create an OSX app with Ionic3 (Cordova).
Now, I want to run any command or script and obtain its output with a callback.
However, I didn't find any sample code, document or tip helps me on the internet.
Do you know any resolution or information?
By the way, with this platform, I'm creating Unity Launcher same as Epic Launcher. Now, I've already made it zsh-zaw version. So, I want to wrap it with GUI and publish it on github.

Windows 8 protocol activation of Desktop app from a Modern App

I have two versions of my custom software. The Modern/Metro app (AppM) and my legacy Desktop application (AppD). I have created a custom protocol for AppM using the manifest that is well understood. I've edited the registry to make a custom protocol handler for AppD and have tested that I can indeed launch AppD using protocol activation from the Run dialog (WIN+R) by supplying the protocol and hitting enter, "AppD://" in this case. I'd like to be able to launch AppM from AppD and AppD from AppM. I've added handlers for each. In AppD I'm using Process.Start(uri) and in AppM I'm using Launcher.LaunchUriAsync(uri). I can get AppM to launch from AppD but I never get AppD to launch from AppM. I've googled and can't find any references to this. I'm assuming it's not possible and might very much have to do with permissions. As this assignment has fallen to me on the project, I need to either prove that it's not possible or find a solution.
I've tested this out using C#/XAml as well as HTML/JS and it's interesting to find that Launcher.LaunchUriAsync(uri).when() success function is called, but the success flag is false. there is no error (or at least the err function is never hit). I'd like to get a better error message and I'm currently trying to dig down that way.
So help with the actual issue, or help with how to debug this would both be greatly appreciated.
Update: To eliminate my own code, I downloaded and installed the launch by association example and simply changed the var uriToLaunch= "http://bing.com" to var uriToLaunch= "AppD:" and it fails every time. This protocol is associated in the registry and the method that I'm using to verify this is by running it using WIN+R from the desktop and the app launches just fine.
BatRT is an application which allows you to run a batch file from a metro app, utilizing URI calls. This should solve your problem.
Simply create a batch file within your metro app, then utilize BatRT to execute the batch file. Code snippets are available at the link above.

Resources