Giter VIP home page Giter VIP logo

minecloud's Introduction

MineCloud

Release Documentation License PRs Welcome Chats

MineCloud is an on-demand multiplayer server hosting solution based on AWS CDK (Cloud Development Kit) that allows users to set up an almost free on-demand game server for a Discord community in just a few minutes.
MineCloud supports the following games out of the box:

Don’t see your favorite games? Consider contributing to the list by following the Create and publish your own MineCloud Configuration Packages guides!


ShortGif

Enjoy your hassle-free server with your friends on Discord at almost no cost!

Features

  1. Discord Bot - start, stop, and backup the server with Discord commands (The server IP address will be sent to the Discord channel after start)
  2. Auto shutdown and backup when no one is online
  3. Support varieties of games out of the box
  4. Easy to setup - we do our best to make the process as simple as possible :)
  5. Almost free (≈60 cents for 20 hr play/month - with a 2 CPUs & 8GB RAM server)
  6. Fully customizable - install whatever mods you like
  7. No maintenance cost - don't have time to play? Just leave it there! It cost almost nothing
  8. Able to support new games by creating and publishing Configuration Packages

Supported Discord Commands

  • mc_start: Start the server and send the IP address to the Discord channel
  • mc_stop: Stop the server
  • mc_restart: Restart the server process
  • mc_backup: Pause the server and create a backup
  • mc_backup_download: Get the download link of the latest backup

Cost Breakdown

with 20 hrs play / month

  • Lambda: Free tier
  • S3: 5GB free tier for first 12 months, $0.03/GB after that (default max backup count is 3)
  • Data Transfer: Free tier, unless total data transfer exceeds 100GB
  • EC2: 0.035 (t2.large spot price) * 20 (hr) ≈ $0.7/month
  • Total: ≈ $0.7/month

Please refer to Spot Instances Pricing and S3 Pricing for more information.

Diagram

Diagram For more details, please check out the wiki page.

Discord Server

Interested in MineCloud? Join our Discord Server!

How To Setup?

If you prefer, we have a step-by-step video tutorial ↓
Video Tutorial

Prerequisites

  1. A Discord account :)
  2. Node.js 18 (or above) - If haven't, go to https://nodejs.org to download and install the latest version
    • Type node --version in the terminal to confirm Node is properly set up. You should see something like this:
      v18.xx.x
      
  3. An AWS account and AWS CLI
    • If haven't already, go to https://aws.amazon.com/ to register an AWS account
    • Download and install AWS CLI from here
      • Type aws --version in the terminal to confirm AWS CLI is properly set up. Something like this should show up:
        aws-cli/2.10.0 Python/3.11.2 Windows/10 exe/AMD64 prompt/off
        
    • Setup AWS CLI credentials:
      • Login to your AWS account, click the account name at the top-right corner and click "Security credentials". Go to the "Access keys" section and create an access key. Notes down Access key and Secret access key
           
    • In the terminal, type:
      aws configure
      
      When prompted, enter the Access key and Secret access key you got from the last step (and optionally choose the "default AWS region" and "output format")
    • Once done, type aws sts get-caller-identity in the terminal to confirm the AWS CLI credentials are set up correctly. Something like this should show up:
      {
        "UserId": "1234567890",
        "Account": "1234567890",
        "Arn": "arn:aws:iam::1234567890:xxx"
      }
      
    • Prerequisites done, now start the fun part :)

Set up MineCloud

  1. Pick a Configuration Package from your desired game. Next to the package you will see the corresponding MineCloud version (e.g. MineCloud x.x.x), download the corresponding version from the MineCloud release page and unzip it.
  2. Open terminal in the MineCloud project directory:
    • Install Node dependencies: npm install
    • Copy and paste the downloaded Configuration Package (e.g. "1.19.4 Vanilla.zip") into the /minecloud_configs folder.
    • Install Configuration Package: npm run install-minecloud-config-pack
      • The following message should be printed:
        Successfully installed <Configuration Package Name> configuration package.
        
  3. Open MineCloud-Service-Info.ts and fill in the following fields:
    • AWS_ACCOUNT_ID: Click the account name at the top-right corner of your AWS console and copy the Account ID
    • AWS_REGION: Pick a region that's closet to you. Some example values are: us-west-2, ap-northeast-1 or eu-west-2
    • DISCORD_APP_ID and DISCORD_PUBLIC_KEY: Go to Discord Developer Portal and click "New Application" to create a new Discord APP. On the "General Information" page, you will find the App Id and Public Key.
         
    • DISCORD_BOT_TOKEN: Go to the "Bot" tab, reset and copy the token
      • This is the Discord BOT that will handle our commands. If there's no BOT shown, click the "Add Bot" button to create a one
           

      You can optionally setup the BOT avatar

    • DISCORD_CHANNEL_WEB_HOOK:
      • Open regular Discord, go to the Discord server you want to add MineCloud to, choose a text channel, and click "Edit Channel".
      • Go to "Integrations" => "Webhooks", click "New Webhook" to create a new Webhook then copy it.
      • This text channel is where our VM server instance will send updates to    

      You can also optionally set up the BOT avatar here

  4. Deploy MineCloud
    • (Optional) Customize Deployment
      • Common customizable options (e.g. VM type, disk size...etc) can be found in minecloud_configs\MineCloud-Configs.ts
      • Follow the "Custom deployment" section on the Configuration Package's home page for games-specific customizations
    • Open the terminal in the MineCloud folder and enter npx cdk list to make sure the build pass. You should see the stack name being printed:
      <Stack Name>
      
    • Bootstrap your AWS account by running npx cdk bootstrap aws://<AWS_ACCOUNT_ID>/<AWS_REGION>
    • Before deploying, read through the End User License Agreement for the game (ex: Minecraft EULA, Factorio EULA)
    • Enter npx cdk deploy to deploy the stack.
    • Sit back and relax, this will take like 5~10 minutes ☕.
      • When you see a "The server instance is ready" message shown up in the Discord channel, this means your game server is almost ready to connect :)
  5. Setup BOT for your Discord server
    • After MineCloud is deployed, go to your AWS CloudFormation page (make sure to select the right AWS region)
    • Click on the deployed stack, go to "Outputs" and copy the value of "Discord Interaction End Point Url"
         
    • Go back to your Discord Developer Portal, select the APP created, and paste the URL into the "INTERACTIONS ENDPOINT URL" field.
         
    • Go to "OAuth2" => "URL Generator", select "application.commands" and click "Copy"
         
    • Open the copied URL (either in Discord or the browser) and add the BOT to your Discord server.
    • You are all set now - Type any command (ex: /mc_restart) in the Discord text channel to give it a try🎉!
         

ONE MORE THING!!!

If you have deployed MineCloud more than once, THERE MIGHT BE DANGLING SPOT INSTANCE REQUESTS THAT WILL CONSTANTLY CHARGE YOU. MAKE SURE TO CHECK YOUR EC2 SPOT REQUESTS TAB AND CANCEL THE DANGLING SPOT REQUEST IF THERE'S ANY!!

Managing the Server after Deployment

After Deployment, the server can be managed by SSH terminals and SFTP clients.
MineCloud's working directory is /opt/minecloud and the game server folder is located at /opt/minecloud/server.
Different Configuration Packages may have different file-saving locations, please refer to the Configuration Package's homepage for more details.

Accessing the Server Terminal

The server can be connected via SSH, the easiest way to do it is by using the "Connect" button at the top-right of the EC2 instance page on the AWS console.
For useful commands, please check out the Useful Linux Commands section on the Wiki.

Interact with the Game Server

The game server is running in a Screen session. To interact with the game server:

  • Type sudo screen -ls to list out the screen session, and type sudo screen -r to enter the session
  • When done, use Ctrl-a Ctrl-d to exit the session.

Manually Start/Stop the Game Server

To manually start/stop the game server:

  • Pause the MineCloud service first: sudo systemctl stop minecloud.service
  • Go to the server directory with: cd /opt/minecloud/server,
  • Manually start the game server: sudo ./start_server.sh
  • Manually stop the game server: sudo ./stop_server.sh
  • Once done, Resume the MineCloud service: sudo systemctl start minecloud.service

Usually, we will want to do this to make sure the server can start up correctly after we've made changes to the server files.
As long as ./start_server.sh and ./start_server.sh function properly, MineCloud service can start/stop the game server when the VM start and stop.

Managing Server Files

To make changes to the server files, connect to your EC2 instance with an SFTP client (ex: WinSCP).

Step-by-Step Guide for Windows:

  • Download and install WinSCP
  • Install PuTTY (which should come with PuTTY Key Generator)
  • Setup key pair:
    • Open PuTTY Key Generator and click "Generate". When done, you should see your public key in the "Public key for pasting into OpenSSH authorized_keys" field
    • Turn on your EC2 instance, connect to the instance terminal via the AWS web console
    • Type sudo nano .ssh/authorized_keys to edit. Copy and paste in the public key from the "Public key for pasting into OpenSSH authorized_keys" field as a new line and ctrl+x to save the file.
    • In PuTTY Key Generator, click "Save private key" to save your private key.
    • Your key pair is ready now!

      You can also use this key to SSH into your server with PuTTY client.

Transferring files via SFTP using WinSCP
  • Before connecting, you will want to change the files' owner first. To do so:
    • In the EC2 terminal launched in previous steps. Run sudo su to become root user, and run chown -R ec2-user:ec2-user /opt/minecloud/server to change the owner of the server files to our WinSCP login user.
    • This is a workaround for our current user permission setup. We will further address this in future releases.
  • In the EC2 terminal, run sudo systemctl stop minecloud.service to pause the MineCloud system service
  • Open WinSCP, paste in the server IP, click "Advanced" => "SSH/Authentication" and select the private key.
  • Save and click "Login" to connect. Input "ec2-user" for the user name when prompted.
  • You are all set now! Navigate to /opt/minecloud/server and start editing the server and world files.
  • When done, run sudo /opt/minecloud/server/start_server.sh to make sure the server can start properly and run sudo systemctl start minecloud.service to enable the MineCloud system service again.

Step-by-Step Guide for Linux

  • In your EC2 dashboard, click on Key pairs, click Create key pair on the top right corner.
  • Enter key pair name then click Create key pair , your key pair will be downloaded to your /Downloads folder.
  • Open up terminal on your local machine, navigate to the folder the key pair is stored.
  • You need to make sure the pem file can only be access by yourself or else the ssh client will refuse to establish a connection with the server, thus you need to set the following file permission.
sudo chmod 400 "name of .pem"
  • Type in the following command to extract the public key from the .pem file.
ssh-keygen -y -f "name of .pem"
  • Copy the results, now turn on your EC2 instance and connect to it via the AWS web console .
  • Edit the authorized_keys using the editor of your choice, eg.
sudo nano .ssh/authorized_keys
  • Paste the public key at the top of authorized_keys. Save and exit.
  • After all that you can finally connect to your instance using SSH by running the command:
ssh -i "name of .pem" <your instance's username>@<your instance's public ipv4 DNS>
  • Example:
ssh -i SSH_SFTP.pem [email protected]
Transferring files via SFTP using Filezilla
  • Connect to your instance via SSH or AWS web console and type in:
sudo chown -R ec2-user:ec2-user /opt/minecloud/server
  • Install Filezilla Client
  • Open Filezilla, open Site Manager by pressing Ctrl + s.
  • Click on New Site, type the name of your server.
  • Protocol: choose SFTP - SSH File Transfer Protocol.
  • Host: paste in the Public ipv4 address of your instance.
  • Logon Type: choose Key file.
  • User: type in the username of your instance, default is ec2-user.
  • Key file: select the pem file.
  • Click Connect and you can start transfering files!

Deploy Multiple Game Servers

  • We can have multiple MineCloud game servers for a Discord server (ex: 1 Minecraft server and 1 Terraria server)
  • Every game server needs to have its own Discord Bot and CloudFormation stack name. CloudFormation Stack name can be set via the STACK_NAME field in minecloud_configs/MineCloud-Configs.ts.
  • We can also have 2 versions of the same game (ex: Minecraft Vanilla 1.19.4 and Minecraft Forge server 1.19.3) as long as they have different Stack names.

Need Help?

Common questions and troubleshooting can be found in the FAQs & Troubleshooting page.
You can also create a question post or ask on Discord if you like.

Support this project

A star will be appreciated ;)
Also, feel free to contribute to the project if you have any thoughts!

minecloud's People

Contributors

314pies avatar aaronho-0716 avatar bglossner avatar krajla avatar yxliaoyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

minecloud's Issues

[Abandoned] Parameterize SSH ingress rule

Why

I found it easier to connect to (and debug) the EC2 instances from the AWS console Session Manager.
image

How

I'd like to not have an open SSH port in that case. Maybe we could add a flag "EC2_SSH_ENABLED" to determine if the port should be open or not.

[Feature request] List of access required for a IAM user

Is your feature request related to a problem? Please describe.
Sort of - it's a non issue, really. I don't exactly know what permissions the access key needs.

Describe the solution you'd like
I'd like in the FAQ for there to be a list of accesses it needs.

Describe alternatives you've considered
I ended up just giving it admin access, which usually isn't a good practice.

Additional context
I'm using this on a IAM user to minimize the amount of root keys I give out.

Thank you for your work on the project - it's quite amazing!

[Feature request] Update a Route53 DNS record with the IP of the EC2 instance

Is your feature request related to a problem? Please describe.
Every time the Ec2 machine starts, a script could be run to update a configurable DNS record.

Describe the solution you'd like
I own a domain which I would like to use to make it easier to connect to the server by creating a record like minecraft.mydomain.cloud.

In the guide How to automatically update IP addresses a script is run at each boot to update a DNS record with the new IP address. The DNS name is added as a tag to the EC2 instance.
This could also be implemented as a Linux systemd service

An alternative solution would be to integrate the DNS update functionality into the Lambda function which posts the IP address into the Discord channel.

Whatever solution is implemented, the script could look at the EC2 instance tags and if there is a DNS_RECORD tag present it could execute the update Route53 dns record functionality. This would make this an optional feature, which can be controlled by giving an optional environment variable DNS_RECORD_TAG=minecraft.mydomain.cloud

[Optional?]Address cold start issue

Task Description

If the command hit the lambda endpoint and the lambda is still cold, it will result in time-out (because our lambda also need to call aws API to spin-up EC2...etc)
Right now how we solved it is by detecting whether the lambda is cold, and prompt user to try again if it's - probably no big deal at most of the time.

This issue should be solvable by utilizing a Discord API/feature that can offer response first and update it later.

Configure Log outputs / Add instruction about where and how we can finds Log

Task description

When something went wrong with our script/service, we want a persistence place to see for logs.
Research and configure the EC2 instance so that we have a centralize folder to look for our logs.
Or at least offer a clear instruction to where we can find the logs.

Test

Make sure the logs exist in the target folder/make sure the instruction is clear and accurate

Document

Update Readme if needed.

[Question] How can the spot instance request issue be resolved?

I'm playing around with cdk deploy and cdk destroy to test the DNS name feature I requested in #68

The "cdk destroy" operation takes ages until it finally fails. I'm not 100% sure yet, but it seems as if the spot instance requests issue, you described somewhere in the comments, led to the issue that a second VM has been created, which does not get deleted by the cdk destroy operation and an attempt to delete the whole stack fails because the ENI is still in use by the second spot instance that is running.

aws ec2 describe-spot-instance-requests --query "SpotInstanceRequests[].SpotInstanceRequestId"

The question is whether there is a way to avoid a second VM to be started, becoming somehow detached from the CDK/CFN state?

5. Auto shutdown the server when no one is online

Task description

Write CDK code to configure server auto shutdown script.

Please refer to our existing script for checking user connection:
https://gist.github.com/314pies/ac0aa3aa4e42e83363b6ca1a6c426564
This script will auto check for TCP and SSH connection and shut down the server if no connection is found

Note:

  • Because every multi-player game have their own connecting protocol (probably either TCP or UDP). We will want to make this part modular enough (and probably open a public interface in the future) so that this solution can be more generic for other multiplayer server hosting.
  • @yxliaoyx Have came up an solution/script for detecting UDP connection for his Project Zomboid server

Test

Make sure the server shutdown when no one is online.

Document

Update Readme if needed.

[Task] Add custom prefix for each configuration package

Is your feature request related to a problem? Please describe.
Currently, every Discord BOT are having the same command prefix - mc.
Which will become messy easily when there's more than one game deployed in the Discord Server.

Describe the solution you'd like
In the configuration package for each game, each BOT should have their own prefix.

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.
N/A

11. Send message to Discord channel when the server start/stop

Task description

Test

Deploy to your dev stack and confirm the message showed up in the Discord channel.

Document
N/A

9. Setup Discord BOT commands during EC2 initialization

Task Description

We want to setup Discord BOT command when spinning up the stack (this only need to be done once)

This is the tutorial (https://discordjs.guide/creating-your-bot/command-deployment.html#guild-commands) for setting it up with a Node project.

Since it's a Node project, it's likely that we can convert it to a lambda and just treat is as a Custom resource.

(Or use the official API instead https://discord.com/developers/docs/interactions/application-commands#registering-a-command)

Test

  • If decided to do it with a lambda, you can utilize the lambda testing function during development.
  • Manually deploy it to confirm it works

Domumentation

N/A

[Task][Planning] Convert to an Integrated Repository with NX

To reduce our reliance on Discord for operational tasks, we have decided to introduce a web page that allows authorized users to manage game servers. Therefore, we need to implement a Web Application, and we have chosen React.js + Next.js as the development options to ensure scalability and flexibility for future development.

As a result, in this mission, we will outline the prerequisites for this change and use NX to convert the project into a monorepo.

Monorepo Conversion using NX:

  • Use NX to convert the project into a monorepo, allowing for efficient management of multiple related packages and components.

[Planning] Plan out backup mechanism details

Task Description

Figured out the details about how the backup mechanism should work.
Some possible options are:

  • S3
  • Git (we use GitHub as our backup mechanism before... but we probably don't want to encourage people doing this)

[Feature request] Make it easy to add server config files to the automated setup

Is your feature request related to a problem? Please describe.
Setting up a Minecraft server often requires some properties to be set in multiple files.
For example my kids like to play with "allow-cheats=true" and I want the whitelisting to be enabled on the server so that I know that only my kids an d their friends can access it.

Describe the solution you'd like
I do not have a good solution yet, but I would like to kickoff a discussion about this.
I could imagine that there is a folder where the following files (in the case of a minecraft server) can be put into:

  • whitelist.json
  • ops.json
  • server.properties

The issue is that I do not want those files to be committed accidentally with all my kids UUIDs and usernames in there. So I could imagine again an approach where we put dummy files in there and one would need to copy them, remove a suffix like "template" and then they will be recognized during server-init and copied to the new machine.

4.5 Setup discord messaging script

Task description

  • Setup discord messaging script so that this can be used for later features (ex: send IP to channel, notfity server update...etc)
  • Do it via CDK

Notes:

Test

Deploy to your dev stack and confirm the message showed up in the Discord channel when running the script.

Document
N/A

[Task] Delay server IP sending time

To-Fill

Please ping me on Discord directly if you're interested in working on this.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Feature request] Support Satisfactory

Is your feature request related to a problem? Please describe.
Satisfactory supports dedicated servers, but is not supported by MineCloud

Describe the solution you'd like
Add support for Satisfactory.

Describe alternatives you've considered
Completely separate package to run that game, but there should be a lot of shared code with this package. So would make sense just to add it on.

Additional context
Game Website: https://www.satisfactorygame.com/
I would like to work on this feature personally

[Task] Update Readme

This reddit comment point it out S3 free tier is only for first 12 months.
We should update the readme to make this clear.

It's also a good idea to add a section for creating a budget for AWS accounts.

4. Configure Minecraft server as a Linux service in EC2 instance, via CDK

Task description

Research and write CDK code that are able to configure Minecraft server as a system service after the EC2 instance start.

Note:

Test

Make sure the you are able to connect to Minecraft server after the instance start

Document

Update Readme if needed.

[Task] Add support to specify backup folders

Task description

Right now, our built-in backup feature only backup the /opt/minecloud/server folder. However, since some games might have different files locations, it will be essential to provide support to backup other folders as well.

Note:

  • This is the server backup script
  • While passing in folder list to the script, pay attention to the EoL(End on Line) character issue between Linux and Windows.

Test

Make sure the feature is working with manual testing.

Document

Update Readme/Wiki if needed.

Installation Trouble

I tried deploying with a brand new AWS account.

I do have multiple AWS account credentials on my laptop so I used the correct profile (passing the --profile) tag

Pre requisites

USER@xxx-MacBook-Pro MineCloud-1.1.0 % node --version
v18.4.0
USER@xxx-MacBook-Pro MineCloud-1.1.0 % aws --version
aws-cli/2.7.9 Python/3.9.13 Darwin/20.5.0 source/x86_64 prompt/off

Terminal Log

xxx@xxx-MacBook-Pro MineCloud-1.1.0 % npx cdk deploy --profile minecraft-discord
Bundling asset MineCloud/MineCloud_discord_commands_register_lambda/Code/Stage...

  cdk.out/bundling-temp-4e685f68940a765a4ed4847d4d773ddf7e2d7dfb3afa6065170b3443da43b77d/index.js  370.3kb

⚡ Done in 22ms
Bundling asset MineCloud/MineCloud_discord_interactions_endpoint_construct/MineCloud_discord_interactions_endpoint_lambda/Code/Stage...

  cdk.out/bundling-temp-6626f17e65c370d5c0f9f5f0aac55e2ce76f0fb27a8fa4ff20c2220cf3e6ca2c/index.js  18.7mb ⚠️

⚡ Done in 152ms
Bundling asset MineCloud/MineCloud_discord_interactions_endpoint_construct/MineCloud_discord_command_processor_lambda/Code/Stage...

  cdk.out/bundling-temp-a4eb7f2edfaee3b0511d1ca7be7999344e11db9698f37ce9f2759340055524ce/index.js  19.0mb ⚠️

⚡ Done in 199ms

✨  Synthesis time: 7.45s

MineCloud: building assets...

[0%] start: Building 97817db928c43d4646fed3437ff70ca3fe8d1ca5d5538e80726641d669c244fd:<AWS_ACC_ID>-ap-south-1
[0%] start: Building 0e22f72895a5bd555e2ce81d5dc6b7d01ac1835cd925dd80276ba2dad75c13fb:<AWS_ACC_ID>-ap-south-1
[0%] start: Building 903be65b9594a9f17d7120273620367e7830b6d087fc9591f31dc5a080049e46:<AWS_ACC_ID>-ap-south-1
[0%] start: Building 2b36d5d4dcb60993ddf36ecf68feed35ecbc70c3b92dcd77638a2c876866ad88:<AWS_ACC_ID>-ap-south-1
[0%] start: Building 85bb78ae8c7c9ad2d7d8a193f0ee234de6d82fdfba52da88120ea46ad54feea4:<AWS_ACC_ID>-ap-south-1
[0%] start: Building e30e6151fa91fad623f41b3e17ed2885697fde9fd59c95edbad26c7ec837a58a:<AWS_ACC_ID>-ap-south-1
[16%] success: Built 97817db928c43d4646fed3437ff70ca3fe8d1ca5d5538e80726641d669c244fd:<AWS_ACC_ID>-ap-south-1
[33%] success: Built 0e22f72895a5bd555e2ce81d5dc6b7d01ac1835cd925dd80276ba2dad75c13fb:<AWS_ACC_ID>-ap-south-1
[50%] success: Built 903be65b9594a9f17d7120273620367e7830b6d087fc9591f31dc5a080049e46:<AWS_ACC_ID>-ap-south-1
[66%] success: Built 2b36d5d4dcb60993ddf36ecf68feed35ecbc70c3b92dcd77638a2c876866ad88:<AWS_ACC_ID>-ap-south-1
[83%] success: Built 85bb78ae8c7c9ad2d7d8a193f0ee234de6d82fdfba52da88120ea46ad54feea4:<AWS_ACC_ID>-ap-south-1
[100%] success: Built e30e6151fa91fad623f41b3e17ed2885697fde9fd59c95edbad26c7ec837a58a:<AWS_ACC_ID>-ap-south-1

MineCloud: assets built

MineCloud: deploying... [1/1]
[0%] start: Publishing 97817db928c43d4646fed3437ff70ca3fe8d1ca5d5538e80726641d669c244fd:<AWS_ACC_ID>-ap-south-1
[0%] start: Publishing 0e22f72895a5bd555e2ce81d5dc6b7d01ac1835cd925dd80276ba2dad75c13fb:<AWS_ACC_ID>-ap-south-1
[0%] start: Publishing 903be65b9594a9f17d7120273620367e7830b6d087fc9591f31dc5a080049e46:<AWS_ACC_ID>-ap-south-1
[0%] start: Publishing 2b36d5d4dcb60993ddf36ecf68feed35ecbc70c3b92dcd77638a2c876866ad88:<AWS_ACC_ID>-ap-south-1
[0%] start: Publishing 85bb78ae8c7c9ad2d7d8a193f0ee234de6d82fdfba52da88120ea46ad54feea4:<AWS_ACC_ID>-ap-south-1
[0%] start: Publishing e30e6151fa91fad623f41b3e17ed2885697fde9fd59c95edbad26c7ec837a58a:<AWS_ACC_ID>-ap-south-1
[16%] success: Published 85bb78ae8c7c9ad2d7d8a193f0ee234de6d82fdfba52da88120ea46ad54feea4:<AWS_ACC_ID>-ap-south-1
[33%] success: Published 2b36d5d4dcb60993ddf36ecf68feed35ecbc70c3b92dcd77638a2c876866ad88:<AWS_ACC_ID>-ap-south-1
[50%] success: Published 97817db928c43d4646fed3437ff70ca3fe8d1ca5d5538e80726641d669c244fd:<AWS_ACC_ID>-ap-south-1
[66%] success: Published 0e22f72895a5bd555e2ce81d5dc6b7d01ac1835cd925dd80276ba2dad75c13fb:<AWS_ACC_ID>-ap-south-1
[83%] success: Published 903be65b9594a9f17d7120273620367e7830b6d087fc9591f31dc5a080049e46:<AWS_ACC_ID>-ap-south-1
[100%] success: Published e30e6151fa91fad623f41b3e17ed2885697fde9fd59c95edbad26c7ec837a58a:<AWS_ACC_ID>-ap-south-1
MineCloud: creating CloudFormation changeset...
4:08:05 PM | CREATE_FAILED        | AWS::CloudFormation::CustomResource | MineClouddiscordcommandsregisterresource
Received response status [FAILED] from custom resource. Message returned: Error: 2023-05-07T10:38:04.485Z c0c2fd89-6da0-4857-a322-43bba04d23b8 Task timed out after 3.01 seconds

Logs: /aws/lambda/MineCloud-MineClouddiscordcommandsregisterlambda95-n8pTPd6Hw3t2

at invokeUserFunction (/var/task/framework.js:2:6)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async onEvent (/var/task/framework.js:1:369)
at async Runtime.handler (/var/task/cfn-response.js:1:1573) (RequestId: cad00625-ab3f-4c88-b864-ee8ec4fd5dc5)


 ❌  MineCloud failed: Error: The stack named MineCloud failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Received response status [FAILED] from custom resource. Message returned: Error: 2023-05-07T10:38:04.485Z c0c2fd89-6da0-4857-a322-43bba04d23b8 Task timed out after 3.01 seconds

Logs: /aws/lambda/MineCloud-MineClouddiscordcommandsregisterlambda95-n8pTPd6Hw3t2

    at invokeUserFunction (/var/task/framework.js:2:6)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async onEvent (/var/task/framework.js:1:369)
    at async Runtime.handler (/var/task/cfn-response.js:1:1573) (RequestId: cad00625-ab3f-4c88-b864-ee8ec4fd5dc5)
    at FullCloudFormationDeployment.monitorDeployment (/Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:380:10236)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async deployStack2 (/Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:383:145458)
    at async /Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:383:128776
    at async run (/Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:383:126782)

 ❌ Deployment failed: Error: Stack Deployments Failed: Error: The stack named MineCloud failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Received response status [FAILED] from custom resource. Message returned: Error: 2023-05-07T10:38:04.485Z c0c2fd89-6da0-4857-a322-43bba04d23b8 Task timed out after 3.01 seconds

Logs: /aws/lambda/MineCloud-MineClouddiscordcommandsregisterlambda95-n8pTPd6Hw3t2

    at invokeUserFunction (/var/task/framework.js:2:6)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async onEvent (/var/task/framework.js:1:369)
    at async Runtime.handler (/var/task/cfn-response.js:1:1573) (RequestId: cad00625-ab3f-4c88-b864-ee8ec4fd5dc5)
    at deployStacks (/Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:383:129083)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async CdkToolkit.deploy (/Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:383:147507)
    at async exec4 (/Users/USER/Downloads/MineCloud-1.1.0/node_modules/aws-cdk/lib/index.js:438:51799)

Stack Deployments Failed: Error: The stack named MineCloud failed creation, it may need to be manually deleted from the AWS console: ROLLBACK_COMPLETE: Received response status [FAILED] from custom resource. Message returned: Error: 2023-05-07T10:38:04.485Z c0c2fd89-6da0-4857-a322-43bba04d23b8 Task timed out after 3.01 seconds

Logs: /aws/lambda/MineCloud-MineClouddiscordcommandsregisterlambda95-n8pTPd6Hw3t2

    at invokeUserFunction (/var/task/framework.js:2:6)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async onEvent (/var/task/framework.js:1:369)
    at async Runtime.handler (/var/task/cfn-response.js:1:1573) (RequestId: cad00625-ab3f-4c88-b864-ee8ec4fd5dc5)
$ % 

AWS CloudFormation

Timestamp Logical ID Status Status reason
2023-05-07 16:08:06 UTC+0530 MineCloud ROLLBACK_IN_PROGRESS The following resource(s) failed to create [MineClouddiscordcommandsregisterresource, MineCloudec2instanceInstanceProfile7C956219]. Rollback requested by user.
2023-05-07 16:08:06 UTC+0530 MineCloudec2instanceInstanceProfile7C956219 CREATE_FAILED Resource creation cancelled
2023-05-07 16:08:05 UTC+0530 MineClouddiscordcommandsregisterresource CREATE_FAILED Received response status [FAILED] from custom resource. Message returned: Error: 2023-05-07T10:38:04.485Z c0c2fd89-6da0-4857-a322-43bba04d23b8 Task timed out after 3.01 seconds Logs: /aws/lambda/MineCloud-MineClouddiscordcommandsregisterlambda95-n8pTPd6Hw3t2 at invokeUserFunction (/var/task/framework.js:2:6) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async onEvent (/var/task/framework.js:1:369) at async Runtime.handler (/var/task/cfn-response.js:1:1573) (RequestId: cad00625-ab3f-4c88-b864-ee8ec4fd5dc5)

[Task] Switch EC2 machine image to Ubuntu 22.04 LTS

Task Description

Right now, we are using Amazon Linux 2 as our main EC2 image.
However:

  1. Some games require more modern libraries (ex: Minecraft Bedrock server requires GLIBC_2.27)
  2. LinuxGSM (Linux Game Server Managers) has better support to Ubuntu
  3. It's (probably) easier to install SteamCMD on Ubuntu

Thus, the main targets for this task are

Here are some useful resources that can help you finish the job:

Testing

  • Deploy and ensure all the features still work
  • Deploy to make sure the Ubuntu image at least works with the following regions:
    • US West
    • EU
    • Asia East

[BUG] [Backup Download] InvalidRequestThe authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.[...]

Hi! Thanks for the project, it seems interesting.

I just installed MineCloud and it went well. I started it, connected to it, played for a few minutes and then started a backup.

Then I tried to ask for the download link. I'm unfamiliar with S3, so I wont paste the whole answer here in case it contains sensitive information, but it was a long-ass link. When I clicked on it, I got the following error:

InvalidRequestThe authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.[...]

(the [...] is again a chain of character I'm not putting here, don't know if it's security sensitive)

I googled the error, it seems to be a problem with my region, which is eu-west-3. Looks like US regions support an older authorization mechanism that is not supported in Europe: Stack Overlow exemple

Again thanks a lot ;)

3. Write CDK code to spin-up an EC2 SPOT instance

Task description

Write CDK code for creating a new EC2 instance stack. The CDK stack should at least support the following:

  • server's region
  • instance type
  • Spot instance
  • (Nice to have) Custom IP inbound-outbound policy.

Test

Make sure the stack deployed succeed.

Document

Update Readme if needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.