Giter Club home page Giter Club logo

infrastructure's Introduction

UseGalaxy.eu Infrastructure Build Status

  • This is our actual infrastructure.
  • Changes made here can be damaging.
  • Be careful.
  • Terraform catches some mistakes but not all

This infrastructure repo will run in Jenkins on cron, to ensure our infrastructure (Cloud VMs etc ...) matches exactly what it should.

All changes should go through pull requests and never directly to the main branch, we will have the Jenkins bot comment on the PR with the terraform plan output, allowing the admin to decide whether or not to merge it.

Layout/Theory

We're using this to manager every cloud resource. If it is something you would do with the OpenStack API or UI, do not do it. Instead, use this repository for it.

Our DNS provider is Amazon AWS/Route53 since they have a mostly reliable service and a nice API.

All changes come in through PRs and are applied automatically by our build server. Sometimes jobs error there but it is normal.

Variables

All important variables like flavour names, AWS Route53 zones, groups of security groups for default things like webservices, etc. go in the variables file.

variable "vgcn_image" {
  default = "vggp-v31-j74-edc5aa3dc22c-master"
}

defines a variable and then you can use this with var.vgcn_image

Instances

All instances are stored in files named instance_<class>_<name>.tf. Class can be:

  • core: needed by usegalaxy.eu to run
  • dedicated: dedicated to some people or a project
  • extra: all other cases Their structure is not too complex:
#        type of resource                 resource name
resource "openstack_compute_instance_v2" "apollo-usegalaxy" {
  # Server name in the OpenStack api. becomes the internal hostname with
  # .novalocal appended
  name            = "apollo.usegalaxy.eu"

  # We have several variables for you to choose from in the vars.tf file.
  image_name      = "var.centos_image"

  flavor_name     = "m1.large"
  key_pair        = "cloud2"

  # You can define this as a list or use the var.sg_webservice for all of the
  # default security groups required for a webservice (egress, ufr ssh, public
  # ICMP, public http(s))
  security_groups = "var.sg_webservice"

  # Here we attach two networks:
  network {
    name = "bioinf"
  }

  network {
    name = "public"
  }
}

# Here we define a DNS record for this VM
resource "aws_route53_record" "apollo-usegalaxy" {
  # The zone needs to be correct for the TLD you want.
  zone_id = "var.zone_usegalaxy_eu"
  # The actual record
  name    = "apollo.usegalaxy.eu"
  type    = "A"
  ttl     = "7200"

  # Here we use a computed value from the first resource, format is from above:
  # "type of resource"."resource name".access_ip_v4
  records = ["openstack_compute_instance_v2.apollo-usegalaxy.access_ip_v4"]
}

When you run make all terraform will sync, and if VMs need to be destroyed and re-created, they will and DNS records will update appropriately.

Commands

All infra IPs (without going to openstack.)

$ ./bin/tfinfo-to-json.sh | jq -r '.openstack_compute_instance_v2 | keys[] as $k | [$k, .[$k]."network.0.fixed_ip_v4"] | @tsv'

infrastructure's People

Contributors

bgruening avatar elichad avatar flowuenne avatar gmauro avatar hechth avatar hexylena avatar itisalirh avatar jasonjgill avatar kysrpex avatar marie59 avatar markuskonk avatar mira-miracoli avatar sanjaysrikakulam avatar sj213 avatar slugger70 avatar smoehrle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infrastructure's Issues

Run only if plan is non-empty

It's a lot of churn in the tfstate file just to bump version numbers, we could improve this significantly by only running the apply if something will change.

They've also provided some nice github action elements, I'm using them for admin-training infra and they make life a lot easier than doing it in jenkins maybe.


      - name: Setup Terraform
        uses: hashicorp/setup-terraform@v1
        with:
          terraform_version: 0.15.4

      - name: Terraform Format
        id: fmt
        run: cd terraform && terraform fmt -check

      - name: Terraform Init
        id: init
        run: cd terraform && terraform init

      - name: Terraform Validate
        id: validate
        run: cd terraform && terraform validate

      - name: Terraform Plan
        id: plan
        run: cd terraform && terraform plan
        continue-on-error: true
        env: ...

Modify GxIT URL for eu subdomains

Hi eu team!

Hope all is ok for you. Is it possible to modify a GxIT URL like https://c0f1771e21d7ee60-83b672c1b14a476180d38bdedbe5360c.interactivetoolentrypoint.interactivetool.ecology.usegalaxy.eu/sample-apps/SIG/ coming from subdomains to point for example https://c0f1771e21d7ee60-83b672c1b14a476180d38bdedbe5360c.interactivetoolentrypoint.interactivetool.usegalaxy.eu/sample-apps/SIG/ non subdomains oriented URL ? This will allow direct display of GxIT content instead of having an intermediate step related to security and https

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.