Coder Social home page Coder Social logo

rstudio-connect's Introduction

  • [RStudio Connect](#RStudio Connect) By Chianeng 2023-09-27

  • [Getting startedr](#Getting started)

    • **PART ONE: WARM-UP-QUESTIONS AND ANSWERS Visit warm-up-exercise directory to learn some basic cloud concepts

    • **PART TWO: Practical exercise

  • [RStudio Connect Installation, Configuration and Terraform Infra-Provisioning](RStudio Connect Installation, Configuration and Terraform Infra-Provisioning)

Tasks To Be Executed:

  1. Install and configure RStudio Connect for Shiny apps.
  2. Provide the IaC configuration of the infrastructure.
  3. The solution has to be directly runnable and accessible via browser
    • Additionally, please satisfy these requirements: The solution follows infrastructure as code principle Create documentation for the client with the low tech skills to be able to reproduce the environment on their own Make sure that time to initialize the deployment is relatively small **The repository with code has pipelines that execute linting

Requirements:

  1. Spin up your VM using a 3rd party provider like AWS. Am using Ubuntu 20.04 LTS (ami) and a t2 medium instance type

  2. Use an ssh tool like gitbash or MobaXterm for ssh. MobaXterm

  3. To Install terraform on your terminal.

  4. Resources to be created includes:

     **vpc and its componenents(igw,subnets,azs,rts,nat-gw,rt-assoc)
     **ec2 instance and its components(sg,eip,keypair)
    
  5. A bashscript to install rstudio Connect

  6. A gitlab ci/cd yaml file to execute linting on the terra-code

Procedure:

1. **Get started** by ensuring you have terraform, git and aws cli installed in your terminal

2. Create a pgitlab repo named **rstudio-connect** and cloned it.
git clone https://gitlab.com/chianeng_projects/rstudio-connect.git
3. To create the IAC for RStudio Connect, Open the following  .tf files:
  • main.tf= to define aws provider and provision resources

  • variable.tf= to parametarize resources and avoid hard coding for code reusability

  • keypair.tf= to avoid hard coding the private key

  • output.tf = to get server ip to access rstudio connect via webserver

  • .gitignore = to reduce the size of the terra directory

  • locals.tf= to store named values to avoid duplication within the code

    1. After writting the Infra Code, run the following terra-commands to provision the resources
  • **To initialize all the .tf files needed to deploy the infrastructure run : terraform init

  • **To check and verify if  all syntaxes within the script are correct : terraform validate

  • **To apply all configurations made on the .tf files run : terraform apply -auto -approve

  • **To remove or delete all applied resources from provider run terraform destroy

    1. After deploying the reources, access the RStudio Connect through the VM's ip gotten as output from the terraform logs plus port 3737 of the RStudio Connect applied

    2. Finally make use of gitlab runner to run the linting pipeline using the gitlab-ci.yml to identify potential errors and vulnerabilties in your terra-files code.

rstudio-connect's People

Watchers

Chia Novette Neng avatar

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.