Deploy P4 on Google Cloud | Admin
If you are the P4 administrator, you need to deploy P4 Server and configure it for your team. You can host P4 Server in your own instance on Google Cloud.
On this page:
Prerequisites
Before you deploy P4 on Google Cloud, you need a Google Cloud account with billing enabled.
For P4 on Google Cloud, you only pay for the infrastructure you use. P4 is free for up to five users and less than 20 workspaces. If you have a larger team, contact Perforce Sales to get additional licenses.
Step 1: Sign up and deploy the P4 image
-
Sign up for P4 on Google Cloud. You will receive an email from Perforce with a link to deploy the P4 image on Google Cloud.
-
In the email, click the link to deploy the image. Log in to your Google account if needed.
-
On the Perforce - P4 page in the Google Marketplace, click Get Started.
-
From the Select a project dialog box, create a new project specifically for the P4 deployment. It is best practice to create a new project, but you can use an existing one. To learn more about creating projects, see the Google Cloud help.
-
Click the project to deploy P4 to.
-
On the Agreements page, accept the terms and agreements and click Agree.
-
In the Successfully agreed to terms dialog box, click Deploy.
-
If you are prompted to enable required APIs, click Enable.
It may take a few minutes to enable the APIs.
-
On the New Perforce - P4 Deployment page, enter a Deployment name for the VM.
Suggested format:
p4-environment
. Example:p4-production
. -
Enter or select information in each section for your P4 deployment. The estimated monthly cost is updated as you make changes.
Machine Type
Use the default settings unless you need a different machine type. You can change these settings later.
Boot Disk
Field Description Boot disk type Select Balanced Persistent Disk unless you need to use another disk type. This disk type has SSD speed and minimizes cost. Boot disk size in GB Enter the boot disk size in GBs. Use 1.5 times your expected amount of P4 depot data unless you need to mount separate drives after deployment. You can increase the size later, but you cannot decrease it. Networking
Field Description Network interface Expand the section to view options. If you have a static external IP address reserved, select it in the External IP field and click Done. Otherwise, use default and change it later. Firewall Select Allow TCP port 1666 traffic from the Internet. P4 uses port 1666. Your team needs this value to connect to P4.
To restrict access to the P4 Server, type a source IP address range in CIDR format in the Source IP ranges for TCP port 1666 traffic box. For example, to only allow access to the P4 Server from your network, use your public IP address appended with/32
. Find your IP address. To make the server accessible to remote users, use0.0.0.0/0
to allow open access from all IP addresses.Stackdriver
Field Description Enable Stackdriver Logging Not required, but can select if needed. Enable Stackdriver Monitoring Not required, but can select if needed. -
Click Deploy.
Deployment may take a few minutes. When deployment is complete, a
DeploymentName has been deployed
message is displayed.
Step 2: Assign a static external IP address to the VM instance
If you used the default external IP address when entering the deployment information, you need to assign a static external IP address to the VM instance.
-
Click
, select Compute Engine and click VM instances.
-
Click the VM Name created for the deployment.
-
Click Edit.
-
Go to the Network interfaces section.
-
Click the arrow to expand the network interface settings.
-
In the External IPv4 address list, select Reserve static external IP address.
-
Optionally, in the Reserve a new static IP address dialog box, enter values for the IP address in the Name and Description boxes.
-
Click Reserve to reserve the IP address.
The Network Service Tier is set to the default for the project you are using.
-
Click Save to save the settings.
Step 3: Update firewall rules
As a best practice, implement a layered security approach to limit access.
Username and password for each user
Provide each user with their own P4 username and password.
Create firewall rules
When the P4 Server was configured during deployment, a firewall rule was automatically created to allow incoming traffic to port 1666 from the specified IP range, usually either a single IP or open to all. To change those rules, you can create firewall rules at no charge using the Google Cloud security interface.
For information about adding firewall rules to your VM instance, see the Google Cloud help.
Step 4: Find and note your deployment outputs
When deployment is complete, find the deployment outputs you need to connect to P4.
-
Click
, select Compute Engine, and click VM instances.
-
Click the VM Name created for the deployment.
-
Note the following information:
Section Value Description Basic information Instance Id Instance ID for the new P4 instance Network interfaces External IP address Public IP address for P4 Server
Step 5: Complete post-deployment tasks
Consider completing the following additional steps after deployment.
- For a production environment, create and mount separate volumes for the /hxdepots, /hxlogs, and /hxmetadata directories.
- Set up a snapshot schedule to back up the /hxdepots and /hxlogs (optional) drives.
P4 credentials
Use the following details to connect to P4 Server from P4 clients. You need the deployment outputs you previously noted.
Value | Format | Example |
---|---|---|
Server | ssl:external-ip:1666
Replace external-ip with the external IP address you noted after deployment. |
ssl:52.186.76.548:1666
|
User | perforce
|
perforce
|
Password | i- instance Id Replace instance Id with the value you noted after deployment. |
i-6135962875513113412
|
P4 Server instance access
To perform administration tasks on the P4 Server, such as checking backups, expanding disk file systems, adding new volumes, checking logs, and more, you need to access the instance.
From the Google Cloud VM details page (preferred)
- Click
, select Compute Engine, and click VM instances.
-
Click the VM Name created for the deployment.
-
Click SSH.
An SSH terminal opens in a new browser window.
From gcloud CLI
See the gcloud CLI help for more information.
-
Install the gcloud CLI and configure it with your account.
- Click
, select Compute Engine, and click VM instances.
-
Click the VM Name created for the deployment.
-
Click the arrow next to SSH and select View gcloud command.
-
Copy the command, paste it in a terminal window, and connect using your local SSH client.
Manage VM settings
You can make changes to the VM instance in Google Cloud.
-
Click
, select Compute Engine, and click VM instances.
-
Click the VM Name created for the deployment.
-
Click Edit.
- Make any changes.
- Click Save to save the settings.
What's next
Next, download and install P4 Visual Client (P4V), which allows you to work with versioned files. Installing P4V also installs the P4 Admin by default. You will use these tools to configure security and add users in later steps. You will also install other tools that you might use when working with P4.
Go to Step 3: Download and install P4V and other client applications.