[Tencent Cloud Studio Practical Training Camp] Use Cloud Studio to build Java and Python projects


1. Cloud IDE

1. Introduction to Cloud IDE

Please add a picture description

Cloud Integrated Development Environment (Cloud Integrated Development Environment, Cloud IDE) is a cloud computing-based development tool designed to provide developers with an environment that does not require the installation and configuration of development tools on a local computer. Cloud IDE allows developers to access an online platform through a web browser, which contains development tools and functions such as code editing, debugging, version control, building and deployment.

Cloud IDE represents the development direction of a research and development model. Possible development trends of this R&D model include:

  • Standardization: A set of IDE development environment on the cloud can be configured in a standardized manner. One person configures related content, and everyone can use it.
  • Customization: You can specify different environment configurations and resource configurations for a specific development environment to achieve customized requirements.
  • Security: The IDE environment on the cloud belongs to the company, which avoids physical copying, and there are more and more effective ways for security supervision of uploading and downloading codes of screenshots of files.
  • Availability at any time: The remote IDE is almost in a standby state at any time, and can be used at any time, avoiding the need to start various service processes locally.

insert image description here

2. The difference between cloud IDE and cloud virtual desktop

Cloud IDE and cloud virtual desktop are two directions of code development on the cloud. The following are some differences:

Cloud Virtual Desktop (Cloud Virtual Desktop) :

Cloud virtual desktop is a solution that virtualizes the complete operating system desktop and provides it to users through cloud services. Key features include:

  • Efficient management: It can realize minute-level cloud desktop delivery, and supports full life cycle management such as creation, distribution, and return of multiple regional cloud desktop instances, greatly improving deployment and maintenance efficiency.

  • Flexible delivery: Cloud Desktop can provide flexible and rich instance collocation solutions, covering complex scenarios such as efficient OA office, secure development, drawing design, video editing, and heavy-duty rendering. The system disk and data disk can be adjusted as needed to meet the cloud storage requirements in various scenarios.

  • Stable and smooth: The cloud desktop instance is based on the stable and reliable Tencent Cloud infrastructure to ensure the security and stability of the cloud desktop. Through adaptive protocol technology to transmit clear graphics and images, end users can obtain an ideal and smooth access experience.

  • Safe and reliable: cloud desktop data is kept in the cloud without loss, desktop policies build security fences, watermarks deter screen captures and photos, and protocol encryption transmits screen variables, effectively improving the security and continuity of core sensitive business access.

云IDE(Cloud Integrated Development Environment)

Cloud IDE is a cloud-based development tool designed to provide developers with an online integrated development environment. Key features include:

  • .Online development environment : Cloud IDE provides a complete development environment, including code editor, debugger, version control and other tools, allowing developers to write, edit, debug and manage code in the browser.

  • Team collaboration : Support real-time collaboration, multiple developers can edit code collaboratively in the same project at the same time.

  • Lightweight tasks : Suitable for light-weight development tasks, such as writing and debugging code, suitable for short-term projects and small applications.

  • Security : In the cloud environment, there are a series of code security management measures such as preventing copying, preventing downloading, code watermarking, and git restrictions.

In general, Cloud IDE focuses more on code development, and has made targeted improvements to the pain points in the development of some existing enterprises in the process of code development, such as security, stability, usability, and reproducibility, which can be greatly improved. Improve the security of our enterprise code and improve the efficiency of development.

2. Introduction to Cloud Studio

Official website: https://www.cloudstudio.net/

1 Introduction

Cloud Studio is a browser-based integrated development environment (IDE) that provides developers with an always-on cloud-based workstation. Users do not need to install Cloud Studio when using it, and can program online anytime, anywhere by opening a browser.

Please add a picture description

As an online IDE, Cloud Studio includes basic IDE functions such as code highlighting, auto-completion, Git integration, and terminal. It also supports real-time debugging, plug-in extensions, etc., which can help developers quickly complete the development, compilation, and deployment of various applications .

insert image description here

Currently, the Cloud Studio online programming tool is applicable to the following scenarios:

  • quick start project

Using Cloud Studio's preset environment, you can directly create the corresponding type of workspace, quickly start the project and enter the development state, without cumbersome environment configuration.

  • Debugging webpages in real time

Cloud Studio has a built-in preview plug-in that can display web applications in real time. When your code is changed, the preview window will be automatically refreshed, so that you can develop and debug web pages in real time in Cloud Studio.

  • Remote access to cloud server

Cloud Studio supports you to connect to your own cloud server, so that you can view files on the cloud server in the editor, and perform online programming and deployment.

2. AI code assistant

Currently focusing on communication, coding, troubleshooting, review, and testing. These large blocks are exerting force.

Communication:
Can't read the code? It doesn't matter, let the AI ​​code assistant help you answer. He is your intimate assistant in the development process. He has learned and mastered more than 20 programming languages ​​and a large number of development paradigms.
A simple understanding is that you can use chat to understand your needs and generate corresponding codes with one click.

Coding:
Support more than 20 kinds of grammar deep learning, support the completion of annotation description, variable completion, function completion, etc.
Automatically generate README, Git configuration, scaffolding and other files according to the directory structure.

Troubleshooting:
compilation error, don't know how to fix it? Also use the search engine to find it based on the error code? Use the AI ​​code assistant's shortcut ability to fix suggestions to find code problems with one click and push a fix. There is a missing =, there may be a null pointer exception, and the AI ​​​​code assistant will help you check and correct errors.

Review:
The AI ​​code assistant proofreads each MR before submitting it, and every time you give the team a review, it is a confident submission.

Test:
After writing the business logic, do you need to write unit tests one by one? Let the AI ​​code assistant help you quickly generate test code with one click.

insert image description here

3. Enterprise source code security

With the development of the times, enterprises in all walks of life will more or less deal with software source codes, and use software systems to better improve enterprise office efficiency, and software source codes have naturally become a new type of enterprise assets. How to ensure that the source code of the enterprise is not leaked has become a pain point that various enterprises are particularly concerned about. This problem has existed for a long time, and each enterprise proposes a corresponding solution according to its own situation. With the rise of the new development mode of cloud development, the source code security of enterprises has added a lower cost, higher efficiency, and relative A more secure solution.

Webpage watermark
When we enable the webpage watermark function, open any workspace through our Cloud Studio, you will find that there is an additional layer of watermark on the editor, which can prevent employees from leaking the source code through screenshots.

copy encryption

When the code copy encryption function is turned on, the download of the code file will also be prohibited synchronously. At this time, you will find that all the text you copy in the editor will automatically become ciphertext after pasting it to the outside, and paste it to the editor Other locations inside the server are normal plaintext, and encryption through copying can prevent employees from leaking the source code through copying

Do not download

By default, the editor we provide supports file upload and download capabilities. When we disable the download function, we will not see the function of downloading code files, which prevents employees from leaking the source code through downloading.

3. Quick start

1. Log in to Cloud Studio

There are currently three client methods: client, browser plug-in, and browser.

insert image description here

There are 3 types of account categories. Coding DevOps, WeChat, Github. It is recommended to log in with a CODING account.

insert image description here

To sign up for Cloud Studio, you need to first sign up for a CODING team. You can go to the CODING registration page(opens new window) and fill in some necessary information to register. For specific steps, please refer to Registration and Invitation(opens new window) .

insert image description here

2. Create a new workspace

insert image description here

The job category can choose hosting space and cloud hosting.

  • Hosting Space: Maintained virtual hosts.
  • Cloud host: user's own virtual machine, currently supports 64-bit Ubuntu 16.04/18.04 and CentOS 7.

The code source currently supports 3 methods:

  • Import warehouse: Support CODING, Github, need to log in account password to associate corresponding information.
  • Warehouse address: download code in the form of Git address.
  • Empty: The code is empty, and you will create it later.

The development environment basically covers common code types and framework templates.

  • Commonly used templates: All in One, Java, Go, VUE, etc.
  • Cloud native template: Serverless Framework.
  • The last class of the framework: Spring Boot, Vue.js, Angular, etc.
  • Website building templates: mkdocs-base, react-static-starter, victor-hugo, etc.

Specification configuration:

At present, it is adapted to several environments with different specifications: 2-core 4G, 4-core 8G, 4-core 16G, 8-core 16G, 8-core 32G, several different specifications.

insert image description here

3. Code space

insert image description here

The UI style of the entire environment is VScode, which is familiar to those who use VSCode, but for developers who use IDea, it still needs a certain adaptation process. There are also corresponding version management, cloud deployment kits, multi-person collaboration, and plug-in management, which are basically the style of VSCode.

4. Project construction

1. Build a Java project

1.1 Create a new workspace

insert image description here

Choose the Java type language, and choose the Spring-boot template, and you can also choose a certain version of the JDK.

insert image description here

1.2 Initialize the project

You can see that the initialized Java project is downloading and building the relevant resource environment.

insert image description here

1.3 Initialization small case

Seeing that a case of familiar environment is provided here, you can initialize the Springboot case according to the operations inside.

Here you can conveniently use your dedicated hosting for development.

We have prepared a small Java example for you to show the use of the Java environment through a Spring Boot demo code.

  1. Run directly in the terminal mvn spring-boot:runto start the service. (Download dependencies are required for the first run, it may take a long time, please be patient)

Please add a picture description

  1. Once fully booted, open the command palette ( Command + Shift + Por Ctrl + Shift + P) and type open preview tab, press enter

Please add a picture description

  1. Enter the port number 8080. If the port is occupied, you can application.propertiesmodify it to another port number in the file. After pressing Enter, the preview window will be opened automatically

Please add a picture description

insert image description here

1.4. Test Java

In the initialization project, the JDK has been installed and the corresponding environment variables have been configured. Running Java commands to view jdk-related information is also supported.

java -version

insert image description here

2. Build the VUE project

2.1 Create a new workspace

insert image description here

It can be viewed in the project list, and the relevant environment of vue is already available.

insert image description here

2.2 Initialize the project

After the project initialization is complete, you can see that the project content is empty. Because I used an empty project and did not use the Git repository for import.

Copy the html file to the project, you can choose to Cloud Studioclick to upload, or manually drag the file to upload.

insert image description here

After the file is uploaded, you can choose to preview the corresponding page, because the Vue-related environment has been paid in advance, so the installation of plug-ins and dependencies is eliminated.

insert image description here

Cloud StudioYou can view the previewed address in , or copy the address to a local browser for viewing.

insert image description here

3. Build a Python project

3.1 Create a new workspace

insert image description here

3.2 Initialize the project

After initialization and built-in Python environment information, you only need to copy the code in to complete subsequent research and development.
insert image description here

insert image description here

5. Use summary

Through the above experiments and recent use, I have experienced a series of content such as Tencent Cloud Cloud Studio account registration, workspace creation, code development, Git management, etc., and realized the convenience of cloud IDE development, and also launched AI code assistant , this can greatly improve the efficiency of our code development, and its excellent code security is also an important guarantee. I feel that the Tencent Cloud Cloud Studio environment is always available and provides a variety of connection methods, which makes me feel a lot. I can conduct my code development anytime, anywhere, and I don’t need to care about the environment startup time and resource consumption, so I can concentrate on code development.

Guess you like

Origin blog.csdn.net/weixin_44624117/article/details/132218091