Introduction to the

With just a few lines of instructions, deploy a self-professing artifact, use technology to write poems for your loved one, organize them into pictures, and send them to your loved one.

Ali cloud experience laboratory address (not yet buy ECS can experience here) developer.aliyun.com/adc/scenari…

Step 1: Connect to the ECS server

1. Open the terminal tool delivered with the system.

  • Windows: CMD or Powershell.
  • MAC: Terminal.

2. Run the SSH [username]@[ipaddress] command on the terminal. You need to replace the username and ipAddress with the login name and public address of the ECS server created in Section 1. Such as:

SSH [email protected]Copy the code

The command output is as follows:3. Enter yes. 4. If you agree to continue, you will be prompted to enter the login password. The password is the ECS login password of the created cloud service.If the login is successful, the following information is displayed:

Step 2: Download the command-line tool

1. Perform the following steps to install the Node.js environment. A. Download the node.js installation package.

Wget HTTP: / / https://npm.taobao.org/mirrors/node/v12.4.0/node-v12.4.0-linux-x64.tar.xzCopy the code
B. Decompress the installation package and rename it.Copy the code
Tar -xvf node-v12.4.0-linux-x64.tar.xz && mv node-v12.4.0-linux-x64 //usr/local/nodeCopy the code
C. Configure environment variables.Copy the code
echo "export PATH=$PATH:/usr/local/node/bin" >> /etc/profile
source /etc/profile
Copy the code

2. On the CLI, run the following command to install the serverless-devs tool.

npm install @serverless-devs/s -g

Copy the code

The command execution result is similar to the following:Note: If the installation process is slow, you can use taobao NPM source, the installation command is

npm --registry=https://registry.npm.taobao.org install @serverless-devs/s -g
Copy the code

3. Run the view version command to check the installation.

s -v
Copy the code

The command execution result is similar to the following:

Step 3: Configure aliyun account information

Note: The experience scenario provides a free ECS server, but the function computing service is used under your own account. The following configuration information also needs to be configured for your own account’s UID, AKID, and AKSecret information. Run the following commands to configure account information:

s config add

Copy the code

Then fill in the following information as prompted.

  • Cloud vendor: Alibaba.
  • AccountID: log in to aliyun function computing console to view your aliyun master AccountID.

  • AccessKeyID and AccessKeySecret: Click Secret on the AccessKey management page to view key information.

After the configuration is successful, information similar to the following is displayed:

Step four: Project deployment

1. Initialize a template project

s init fc-poem -p alibaba
Copy the code

2. Enter the project

cd fc-poem
Copy the code

3. Run the s deploy command to deploy the system.

After the deployment is successful, a temporary domain name is generated. You can replicate the temporary domain name for access testing.

Step 5: Project experience

Open our path address in a browserWrite the content in the input box, and then click to generate ancient poems, wait for a moment (if not successfully generated, or a long time no result, you can click to generate again), and then you can see the generated ancient poems, click to generate pictures to see the picture:

Step 6: Expand your thinking

Although this is said to generate a simple picture, but in fact, this is an artificial intelligence + image processing project. Part of artificial intelligence: here is the training of the model, and then through the user input, generate a poems, this part of the model also run on ali function of the cloud computing, but because the model is too large may need NAS, etc., so there is no teach people how to deploy the model, it provides an interface for everyone to use directly. This is the easiest, quickest way to experience the project. Of course, everyone in the process of using, you can also modify the code, to replace the picture, here is just a process to throw a brick to introduce jade. Ancient poetry is only generated by AI reasoning, so whether it has high literary value or not is something I am not knowledgeable enough to judge, but I believe that with the development of The Times, the model will be more and more perfect. I also believe that as Serverless continues to evolve, there will be more and more interesting applications for functional computing. Serverless wrote poetry for you this time, what about next time? Look forward to everyone’s “imagination”!