Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access file system in Service Fabric

I need to encode video using ffmpeg in Service Fabric service when I receive new message from Service Bus queue. I can extract ffmpeg.exe from resources and run it but can I save input/output video files in internal file system?

like image 239
Yuriy Gavrishov Avatar asked Jun 22 '16 10:06

Yuriy Gavrishov


People also ask

How do I access Fabric Explorer service?

Running Service Fabric Explorer from the cluster For developer workstation setup, you can launch Service Fabric Explorer on your local cluster by navigating to https://localhost:19080/Explorer.

Where can I find service Fabric logs?

Access the logs of a running container Container logs can be accessed using Service Fabric Explorer. In a web browser, open Service Fabric Explorer from the cluster's management endpoint by navigating to http://mycluster.region.cloudapp.azure.com:19080/Explorer .

What is Servicefabric?

Service Fabric is Microsoft's container orchestrator for deploying and managing microservices across a cluster of machines, benefiting from the lessons learned running Microsoft services at massive scale.

Is service Fabric Iaas or PaaS?

Azure Service Fabric is a Platform as a Service (PaaS) offering designed to facilitate the development, deployment and management of highly scalable and customizable applications for the Microsoft Azure cloud platform.


1 Answers

I tested it on local cluster by following code:

    protected override async Task RunAsync(CancellationToken cancellationToken)
    {
        while (true)
        {
            cancellationToken.ThrowIfCancellationRequested();

            string filename = "testFile.txt";
            File.AppendAllText(filename, "test. ");

            string content = File.ReadAllText(filename);
            System.Diagnostics.Trace.WriteLine("Content:" + content);
            System.Diagnostics.Trace.WriteLine(new FileInfo(filename).FullName);

            await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
        }
    }

The result output was:

Content:test. 
C:\SfDevCluster\Data\_App\_Node_3\SampleAppType_App51\work\testFile.txt
Content:test. test. 
C:\SfDevCluster\Data\_App\_Node_3\SampleAppType_App51\work\testFile.txt
Content:test. test. test. 
C:\SfDevCluster\Data\_App\_Node_3\SampleAppType_App51\work\testFile.txt

But path was changed on the next run to C:\SfDevCluster\Data_App_Node_3\SampleAppType_App52\work\testFile.txt.

So I suppose the answer is:

It's possible to use local file system but only for temporary files. And I think it's a good practice to clean up the system at the end of iteration.

like image 198
Yuriy Gavrishov Avatar answered Sep 25 '22 00:09

Yuriy Gavrishov