Create An Env File For Mac

-->

You can build Azure Service Fabric applications to run on Linux clusters by using Mac OS X. This document covers how to set up your Mac for development.

Prerequisites

Azure Service Fabric doesn't run natively on Mac OS X. To run a local Service Fabric cluster, a pre-configured Docker container image is provided. Before you get started, you need:

  • At least 4 GB of RAM.
  • The latest version of Docker.

Tip

To install Docker on your Mac, follow the steps in the Docker documentation. After installing, verify your installation.

Create a local container and set up Service Fabric

To set up a local Docker container and have a Service Fabric cluster running on it, perform the following steps:

Unlike the old virtualenv tool, pyvenv doesn’t support creating environments with arbitrary versions of Python, which means you’re stuck using the default Python 3 installation for all of the environments you create. While you can upgrade an environment to the latest system version of Python (via the -upgrade option), if it changes, you.

  1. Update the Docker daemon configuration on your host with the following settings and restart the Docker daemon:

    You can update these settings directly in the daemon.json file in your Docker installation path. You can directly modify the daemon configuration settings in Docker. Select the Docker icon, and then select Preferences > Daemon > Advanced.

    Note

    Modifying the daemon directly in Docker is recommended because the location of the daemon.json file can vary from machine to machine. For example,~/Library/Containers/com.docker.docker/Data/database/com.docker.driver.amd64-linux/etc/docker/daemon.json.

    Tip

    We recommend increasing the resources allocated to Docker when testing large applications. This can be done by selecting the Docker Icon, then selecting Advanced to adjust the number of cores and memory.

  2. In a new directory create a file called Dockerfile to build your Service Fabric Image:

    Note

    You can adapt this file to add additional programs or dependencies into your container.For example, adding RUN apt-get install nodejs -y will allow support for nodejs applications as guest executables.

    Tip

    By default, this will pull the image with the latest version of Service Fabric. For particular revisions, please visit the Docker Hub page

    Steam Achievement Manager This is the code for SAM, originally released in 2008, last major release in 2011, and last updated in 2013 (a hotfix). The code is being made available so that those interested can do as they like with it. Steam achievement hack for mac download.

  3. To build your reusable image from the Dockerfile open a terminal and cd to the directly holding your Dockerfile then run:

    Note

    This operation will take some time but is only needed once.

  4. Now you can quickly start a local copy of Service Fabric, whenever you need it, by running:

    Tip

    Provide a name for your container instance so it can be handled in a more readable manner.

    If your application is listening on certain ports, the ports must be specified by using additional -p tags. For example, if your application is listening on port 8080, add the following -p tag:

    docker run -itd -p 19080:19080 -p 8080:8080 --name sfonebox microsoft/service-fabric-onebox

  5. The cluster will take a moment to start. When it is running, you can view logs using the following command or jump to the dashboard to view the clusters health http://localhost:19080:

  6. To stop and cleanup the container, use the following command. However, we will be using this container in the next step.

Known Limitations

The following are known limitations of the local cluster running in a container for Mac's:

  • DNS service does not run and is not supported Issue #132

Set up the Service Fabric CLI (sfctl) on your Mac

Follow the instructions at Service Fabric CLI to install the Service Fabric CLI (sfctl) on your Mac.The CLI commands support interacting with Service Fabric entities, including clusters, applications, and services.

  1. To connect to the cluster before deploying applications run the command below.

Create your application on your Mac by using Yeoman

Service Fabric provides scaffolding tools that help you to create a Service Fabric application from the terminal by using the Yeoman template generator. Use the following steps to ensure that the Service Fabric Yeoman template generator is working on your machine:

  1. Node.js and Node Package Manager (NPM) must be installed on your Mac. The software can be installed by using HomeBrew, as follows:

  2. Install the Yeoman template generator on your machine from NPM:

  3. Install the Yeoman generator that you prefer by following the steps in the getting started documentation. To create Service Fabric applications by using Yeoman, follow these steps:

  4. After you install the generators, create guest executable or container services by running yo azuresfguest or yo azuresfcontainer, respectively.

  5. To build a Service Fabric Java application on your Mac, JDK version 1.8 and Gradle must be installed on the host machine. The software can be installed by using HomeBrew, as follows:

    Important

    Current versions of brew cask install java may install a more recent version of the JDK.Be sure to install JDK 8.

Deploy your application on your Mac from the terminal

After you create and build your Service Fabric application, you can deploy your application by using the Service Fabric CLI:

  1. Connect to the Service Fabric cluster that is running inside the container instance on your Mac:

  2. From inside your project directory, run the install script:

Set up .NET Core 2.0 development

Install the .NET Core 2.0 SDK for Mac to start creating C# Service Fabric applications. Packages for .NET Core 2.0 Service Fabric applications are hosted on NuGet.org, which is currently in preview.

Install the Service Fabric plug-in for Eclipse on your Mac

Azure Service Fabric provides a plug-in for Eclipse Neon (or later) for the Java IDE. The plug-in simplifies the process of creating, building, and deploying Java services. To install or update the Service Fabric plug-in for Eclipse to the latest version, follow these steps. The other steps in the Service Fabric for Eclipse documentation are also applicable: build an application, add a service to an application, uninstall an application, and so on.

The last step is to instantiate the container with a path that is shared with your host. The plug-in requires this type of instantiation to work with the Docker container on your Mac. For example:

The attributes are defined as follows:

  • /Users/sayantan/work/workspaces/mySFWorkspace is the fully qualified path of the workspace on your Mac.
  • /tmp/mySFWorkspace is the path that is inside of the container to where the workspace should be mapped.

Note

If you have a different name/path for your workspace, update these values in the docker run command.

If you start the container with a name other than sfonebox, update the name value in the testclient.sh file in your Service Fabric actor Java application.

Next steps

There are two ways to set environment variables outside of Maya: using the standard operating system commands, or editing the Maya.env file. Using the Maya.env file is recommended so that you don’t clutter the standard environment settings with Maya-specific variables. You can also set up Maya.env as a roaming profile to be shared by many machines; this can be useful, for example, when you are performing distributed rendering among several Windows machines. See your networking documentation for details on setting up roaming profiles.

(All platforms) To set environment variables in a Maya.env file

  1. Create a text file named Maya.env.

    (Mac OS X) Maya.env is a text file that you can create and edit with any text editor. If you use TextEdit or a word processing program, be sure to save it as an ASCII (basic) text file, not RTF. (In the TextEdit Preferences window, set New Document Format to Plain text, and under Saving, turn off the option Append “.txt” to plain text files.)

    Because the .env extension is not recognized as a text file, you may need to open Maya.env from a word processing application instead of double-clicking the filename or icon.

  2. Save it to one of the following directories:
    • (Windows®)
      • drive:Documents and SettingsusernameMy Documentsmayaversion
      • drive:Documents and SettingsusernameMy Documentsmaya
    • (Mac OS X)
      • /Users/username/Library/Preferences/Autodesk/maya/version
      • /Users/username/Library/Preferences/Autodesk/maya
      NoteDo one of the following to open the Preferences directory using Mac OS X Lion:
      • Select Finder > Go > Go to Folder and type the directory path (/Users/username/Library/Preferences).
      • From the Terminal window, navigate to the Preferences directory and type open.
    • (Linux®)
      • ~/maya/version
      • ~/maya
        Note
        • Make sure to capitalize Maya.env.
        • On Windows and Linux, you can change the location where Maya looks for Maya.env by setting the MAYA_APP_DIR environment variable using the operating system methods described below.
  3. Set each variable on a single line in the format:
    • You can set any variable, including ones that you define yourself. The only variables you cannot set in Maya.env are MAYA_APP_DIR (all platforms), and HOME (Linux and Mac OS X) or USERPROFILE (Windows).
    • If you define your own variable, make sure it’s name does not contain spaces, tabs, or any of the following characters: / : * ' < >
    • You can use variable substitution by typing either $variable (Linux and Mac OS X) or %variable% (Windows). For example:

    Linux, Mac OS X:

    Windows:

    • For directory paths use backslash () on Windows and forward slash (/) on Linux and Mac OS X.
    • To separate several paths, use a semicolon (;) on Windows and a colon (:) on Linux and Mac OS X.
    • Maya ignores blank lines and whitespace around the name, equal sign, and value. Lines that begin with # are considered comments and also ignored.

Examples

  • This example uses Mac OS X-specific formatting and typical folders.
  • The following example shows how you can define your own variable (SHARED_MAYA_DIR) and use it to set the value of other Maya variables.
  • This example is the same as Linux, but with Windows-specific formatting.
NoteAlthough we show platform-specific formatting for such things as path separators and variable markers above, Maya will understand the different formatting styles no matter which platform you are on.

We still recommend using the formatting conventions specific to your platform to avoid any possible errors (for example, copying and pasting paths between Maya.env and a shell).

Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License