Ncloud TensorFlow Server creation guide (Private Subnet on VPC)

Prev Next

Available in VPC

1. Ncloud TensorFlow Server Overview

Ncloud TensorFlow Server is a deployment-based service that provides TensorFlow, which is the most popular tool among data analysts, along with other leading Deep Learning and Machine Learning packages.

Because packages for data preprocessing, visualization, natural language processing, machine learning, and deep learning are included, you can perform most data analysis tasks. If needed, you can easily install additional packages or upgrade existing ones using the GUI or console commands in Jupyter Notebook.

Web-based Jupyter Notebooks allow you to work in a consistent analysis environment from anywhere, enabling you to check results instantly and share them easily with others.

Management scripts are also provided to simplify Jupyter process management within a terminal environment.

Furthermore, to support beginners, the service offers comprehensive examples ranging from data exploration and visualization to Machine Learning techniques such as regression, classification, and clustering with Scikit-Learn, as well as Deep Learning regression and classification using Keras and TensorFlow.

2. Frequently Asked Questions Before Use

Q. What is Ncloud TensorFlow Server?

  • Ncloud TensorFlow Server is a service that enables the rapid implementation of Deep Learning and Machine Learning by providing major Deep Learning and Machine Learning packages, including TensorFlow, along with a web-based Jupyter Notebook for writing code.
  • Ncloud TensorFlow Server utilizes TensorFlow, an open-source machine learning software library developed by the Google Brain team.

Q. What types of products are available?

  • Two products are available based on the operating system: 'Ubuntu-16' and 'CentOS-7'. (OS versions may vary.)
  • While the provided packages are identical regardless of the OS, we recommend selecting the more widely used Ubuntu product unless you have a specific reason otherwise.

Q. Which packages are provided, and can I only use the ones included?

  • The primary packages included are TensorFlow, Keras, and PyTorch.
  • Since the service uses the Anaconda package management tool, you can install additional packages using the conda binary.
  • For package installation and management, see the Package Management section in Jupyter Notebook user guide.

Q. Can I use Java or other languages besides Python?

  • TensorFlow provides APIs for Java and Go, but they do not guarantee stability. You should use Python.

Q. What server types are available?

  • Ncloud TensorFlow Server types provided by NAVER Cloud Platform include Standard, High Memory, and GPU. Each server type has the following characteristics.

  • Standard: The standard server of NAVER Cloud Platform services, suitable for a wide range of IT business use cases. It provides well-balanced server specifications with high availability and stability.

  • High Memory: A high-memory server with 64 GB or more of memory, suitable for running applications that are highly dependent on memory performance. Up to 10 High Memory servers can be created. If needed, the instance limit can be adjusted upon request to customer support.

  • CPU Intensive: Equipped with TensorFlow optimized for AVX512 vector operations on Intel Xeon processors, making it suitable for high-performance deep learning workloads. This CPU type currently supports Ubuntu 16.04 only.

  • GPU: A server equipped with V100 or T4 GPUs, suitable for environments that require fast data processing. You can create up to five GPU servers. If you need more, ask customer support to adjust your instance limit.

Q. I have created an Ncloud TensorFlow Server. Where do I write the code?

  • If you create an Ncloud TensorFlow Server in a Private Subnet, external access via a public IP is not available. Therefore, at least one additional Public Subnet is required.
      1. Create an Ncloud TensorFlow Server VM in the Private Subnet.
      1. Create a Windows VM in the Public Subnet.
      1. Assign a public IP to the Windows VM, and then connect to the Windows VM.
      1. While connected to the Windows VM, access Jupyter Notebook using the private IP of the Ncloud TensorFlow Server VM.
  • You can write TensorFlow code in Jupyter Notebook. After connecting to the Windows VM created in the additional Public Subnet, access [private IP address:18888] in a web browser.
  • The 'samples' folder includes data processing, visualization, and TensorFlow examples. Beginners in data analysis are encouraged to refer to these files.

Q. How do I use TensorBoard?

Q. I cannot access Jupyter Notebook.

  • The Jupyter process inside the Ncloud TensorFlow Server VM may be stopped. Run the jup restart command in the terminal to restart the process. (SeeJupyter process management)

Q. (GPU only) The TensorFlow code fails with an 'out of memory' message.

  • Method 1. If multiple codes are executed simultaneously, an OOM (Out of Memory) issue may occur when the code that starts first occupies all available GPU memory. Terminate (shut down) the previously running code and then try again.
  • Method 2. Following the guidance provided in the official TensorFlow documentation, add code to limit GPU memory usage, as shown below.
  • By default, TensorFlow maps almost all memory of all GPUs so that it is visible to the process (assuming the GPUs are included in CUDA_VISIBLE_DEVICES). This behavior helps reduce memory fragmentation and allows relatively scarce GPU memory resources to be used more efficiently at the device level. You can control which GPUs TensorFlow can access by using the tf.config.experimental.set_visible_devices method.
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
  # Limit TensorFlow to use only the first GPU.
  try:
    tf.config.experimental.set_visible_devices(gpus[0], 'GPU')
  except RuntimeError as e:
    # Accessible devices must be configured at program startup.
    print(e)
  • In some cases, the system may allocate only a portion of the available memory to a process, or the process may use only the amount it requires. TensorFlow provides two methods to support this behavior.

The first method is to enable memory growth by calling tf.config.experimental.set_memory_growth. This allows TensorFlow to allocate only the amount of GPU memory required at runtime. Initially, TensorFlow allocates a small amount of memory. As the program runs and additional GPU memory is required, the GPU memory region allocated to the TensorFlow process is expanded dynamically. Memory is not released, because releasing memory can worsen memory fragmentation. To enable memory growth for a specific GPU, add the following code before defining any tensors or operations.

gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
  try:
    tf.config.experimental.set_memory_growth(gpus[0], True)
  except RuntimeError as e:
    # Memory increase must be configured at program startup.
    print(e)

3. Create Ncloud TensorFlow Server VM

Prerequisite 1. Create a VPC

Navigate to i_menu > Services > Networking > VPC to create VPC in the NAVER Cloud Platform console VPC. You need at least one VPC. Within a single VPC, you can create multiple Ncloud TensorFlow Servers.

1-VPC_vpc_ko

Prerequisite 2. Create a Subnet

You can create a private subnet in a VPC to restrict access so that it is available only within the specific VPC environment.

Create a subnet by setting the Internet Gateway dedicated attribute to N (Private).

2-1-SUB-private_vpc_ko

Step 1. Access console

In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server.

tensorflow-vpc-3-1-list_vpc_ko

  • To create server, click [Create server].

tensorflow-vpc-3-1-tensorflow_vpc_ko

Step 2. Ncloud Tensorflow Server VM setting

Select the VPC, Subnet, storage type, server type, and pricing plan, then enter the server name.

tensorflow-vpc-3-2-spec-priv_vpc_ko

  • VPC: Select the VPC you created earlier. (Example: vpc-tensorflow)

  • Subnet: Select Private Subnet. (Example: vpc-sub-pri-tensorflow)

  • Storage type: Select the storage type to use as the boot storage.

    • Select SSD for services that require high I/O performance. Select HDD for general-purpose services. Note that the system can use additional SSD storage only when the boot storage is an SSD.
  • Server type: Select the desired server type.

    • Some server specifications may not be supported depending on the boot disk type.
    • Select one of the following server types based on your intended use: Standard, High Memory, or GPU Server.
  • Choose Pricing plan: Select either a monthly pricing plan or an hourly pricing plan.

  • Server name: Enter the server name.

    • This name is used to identify the server and must be unique.
  • Network Interface: Configure the Network Interface. You can create up to three network interfaces per server.

  • Public IP: A private subnet does not support public IP assignment. Select Not configured.

    • To create a public IP together with the server, you must select a Public Subnet and set the number of servers to one.
  • Next: After completing the server settings, click [Next].

Step 3. Authentication key settings

If you already have an authentication key, select Use existing authentication key. If you do not have one, create a new authentication key by following the steps below.

tensorflow-vpc-3-3-auth_vpc_ko

  1. Select Create a new authentication key.

  2. Enter the name of authentication key.

  3. Click [Create and save authentication key] to save the authentication key file to your local PC.

  • A new authentication key is issued.
  • After saving, store the authentication key in a secure location on your PC.
  • The authentication key is used to retrieve the initial administrator password.
  1. Click [Next].

Step 4. Firewall settings

You can configure firewall settings using an existing ACG.

tensorflow-vpc-3-4-acg_vpc_ko

  • You must select at least one ACG. A default ACG is automatically provided when you create a VPC. Choose one from the list of available options, which includes the default ACG.

    • You can select up to five ACGs.
    • You must select at least one ACG for [Next] to become enabled and proceed with the configuration.
  • Select the ACG you want to configure and click [Next].

Step 5. Final review

Review the configured settings.

tensorflow-vpc-3-5-final-priv_vpc_ko

  • Final review: Check that the server image, server, authentication key, and ACG are configured correctly.

  • [Create server]: After completing the final review, click the button to create the server.

    • Server creation may take several minutes to several tens of minutes to complete.

Step 6. Check in the server list

Verify the created server in the server list.

tensorflow-vpc-3-6-created-priv_vpc_ko

  • Wait until the server is created, the packages are fully installed, and the server status changes to Running.

4. Jupyter access environment setup after creating an Ncloud TensorFlow Server

This section explains how to access an Ncloud TensorFlow Server VM created in a Private Subnet. Because a Private Subnet cannot be accessed from outside, you must create a Public Subnet.

You can access the VM in the Private Subnet by creating a Windows VM in the Public Subnet.

Create a Public Subnet

Create a subnet by setting the Internet Gateway dedicated attribute to Y (Public).

2-1-SUB-public_vpc_ko

Create a Windows VM

After remotely connecting to the Windows VM created in the Public Subnet, access the Ncloud TensorFlow Server VM created in the Private Subnet.

You must create the Windows VM in a Public Subnet.

Select a Windows VM

tensorflow-vpc-4-win-1_vpc_ko

Select Windows VM specifications

Select the VPC, Subnet, storage type, server type, and pricing plan, then enter the server name.

You must create the Windows VM in a Public Subnet.

tensorflow-vpc-4-win-2_vpc_ko

  • VPC: Select the VPC you created earlier. (Example: vpc-tensorflow)

  • Subnet: Select a Public Subnet. (Example: vpc-sub-pub-tensorflow)

  • Storage type: Select the storage type to use as the boot storage.

    • Select SSD for services that require high I/O performance. Select HDD for general-purpose services. Note that the system can use additional SSD storage only when the boot storage is an SSD.
  • Server type: Select the desired server type.

    • Some server specifications may not be supported depending on the boot disk type.
    • Select one of the following server types based on your intended use: Standard, High Memory, or GPU Server.
  • Choose Pricing plan: Select either a monthly pricing plan or an hourly pricing plan.

  • Server name: Enter the server name.

    • This name is used to identify the server and must be unique.
  • Network Interface: Configure the Network Interface. You can create up to three network interfaces per server.

  • Public IP: To automatically assign a public IP when creating the VM, select the [Assign new public IP].

    • To create a public IP together with the server, you must select a Public Subnet and set the number of servers to one.
  • Next: After completing the server settings, click [Next].

Windows VM Authentication key settings

tensorflow-vpc-4-win-3_vpc_ko

Windows VM ACG settings

tensorflow-vpc-4-win-4_vpc_ko

Final confirmation for Windows VM creation

tensorflow-vpc-4-win-5_vpc_ko

Apply for a public IP address

To connect to the Windows VM, create a public IP address. (Additional charges apply for using a public IP address.)

In the VPC environment of the NAVER Cloud Platform console, navigate to i_menu > Services > Compute > Server > Public IP.

tensorflow-vpc-4-win-6_vpc_ko

  1. In Select target server select the Windows Server to which the public IP address will be assigned.

ACG settings

Add rules to the ACG for terminal access via SSH (TCP/22) and Jupyter Notebook (TCP/18888). If required, also add a rule for TensorBoard (TCP/18889).

tensorflow-vpc-4-2-acg_vpc_ko

  1. From the left menu, select ACG.

  2. Select the ACG chosen during server creation, then select [ACG settings]at the top.

  3. In ACG rule settings, enter the protocol, access source, and allowed ports, then create the rule.

  • Protocol: Select from TCP, UDP, or ICMP
  • Access source: Enter an IP address or an ACG name
  • Allowed port: Specify a single port or a port range
  • To access the terminal, add an SSH ('TCP/22') rule to the target server's ACG. If you plan to use Jupyter Notebook and TensorBoard, ensure you also add rules for 'TCP/18888' and 'TCP/18889', respectively.
  • To add a rule, enter the protocol, source, and allowed port, then click [Add].
  1. After completing the configuration, click [Apply].

  2. You can check detailed information in the [Details] tab, and review the configured rules in the [View rules] tab.

Remote access to the Windows VM

Use a remote access program (for example, Remote Desktop or Microsoft Remote Desktop) to connect to the Windows VM. Enter the Windows VM’s Public IP and Administrator password.

See Window Server access guide.

Enter Windows VM login credentials

tensorflow-vpc-4-win-7_vpc_ko

  1. Enter the administrator username for the Windows VM.

  2. Enter the administrator password for the Windows VM.

Enter the public IP of the Windows VM.

tensorflow-vpc-4-win-8_vpc_ko

  1. Enter the public IP address of the Windows VM.

  2. Enter the administrator username and password that you configured earlier for the Windows VM.

Verify remote access to the Windows VM

tensorflow-vpc-4-win-9_vpc_ko

Verify Jupyter Notebook operation

After connecting remotely to the Windows VM, access Jupyter Notebook. Launch the Chrome browser, enter the private IP address of the Ncloud TensorFlow Server VM, and connect to Jupyter Notebook.

Accessing Jupyter Notebook from the Windows VM

tensorflow-vpc-4-win-10_vpc_ko

  • ‘Internet Explorer’ is not recommended for using Jupyter Notebook due to security settings, so we recommend using the ‘Chrome’ browser.

  • The Jupyter Notebook access address is http://{private-IP}:18888.

    • For example, if the private IP is 10.0.0.70, the access url is http://10.0.0.70:18888.
  • The initial password for Jupyter Notebook is the VM server name. For security, it is recommended to change the password before use.

Internet Explorer security settings on a Windows VM

To use Jupyter Notebook smoothly via Internet Explorer on Windows, you must enable JavaScript in the security settings.

tensorflow-vpc-4-win-11_vpc_ko

  • Internet Explorer > Tools > Internet option > Security tab > User-defined > Allow JavaScript

  • You can also install the Chrome browser on the Windows VM and use Chrome to access Jupyter Notebook.

5. Jupyter Notebook management

Connect to the Ncloud TensorFlow Server VM using a terminal program (such as PuTTY) and change the Jupyter password.

You can easily change the password and manage the Jupyter process using the provided management scripts.

Check administrator password

To connect to the Ncloud TensorFlow Server VM using a terminal program (such as PuTTY), you need to know the administrator password.

tensorflow-vpc-5-1-password_vpc_ko

  1. From the left menu, select Server.

  2. Select the target server, then from the Server management and settings, select Check administrator password.

  3. [Drag the file here or click here] and attach the authentication key file (.pem) that was saved on your local PC when the server was created.

  4. After attaching the file, click [Check password] to obtain the password used for the initial server login via the terminal program.

  • After logging in to the server, it is recommended to change the password to one that the administrator can easily remember.

How to connect to a VM using a terminal program

You can connect to the Ncloud TensorFlow Server VM using the administrator password. After remotely connecting to the Windows VM, use a terminal program to connect to the TensorFlow VM.
tensorflow-vpc-5-2-ssh-priv_vpc_ko

  1. Launch the terminal program, then enter the private IP address of the Ncloud TensorFlow Server VM.

  2. Enter the connection information for the Ncloud TensorFlow Server VM.

  • login as: root
  • password: Enter the administrator password confirmed in the previous step.
  1. After logging in, it is recommended to change the root account password to one that you can easily remember.
  • Enter the 'passwd root' command and then enter a new password.

Change the Jupyter password

The initial password used for Jupyter Notebook is set to the server name. For security reasons, change the password using the provided script.

tensorflow-vpc-5-4-juppasswd_vpc_ko

  1. In the terminal, enter 'jup passwd' to change the password.
  • Check initial password: Same as the server name shown in Console > Server > Server list.
  • The password must include letters, numbers, and special characters, and must be at least 8 characters long.
  • When you run the password change script, the Jupyter process restarts automatically.

Manage the Jupyter process

Use the provided scripts to stop or restart the Jupyter process when you need to apply changes to environment configuration files.

tensorflow-vpc-5-5-jup_vpc_ko

  1. Stop the Jupyter process: $ jup stop

  2. Start the Jupyter process: $ jup start

  3. Stop and restart the Jupyter process: $ jup restart

Manage the TensorBoard process

If you need to start the TensorBoard process for the first time after creating the server, or if you need to restart it, you can use the provided scripts to start or stop the process.

tensorflow-vpc-5-5-tb_vpc_ko

  1. Stop the TensorBoard process: $ jup tb-stop

  2. Start the TensorBoard process: $ jup tb-start