Esthenia-collaboration / rfswarm-docker

Simple docker container wich make rswarm performance tool easy to launch
1 stars 0 forks source link

Issue #2 minimal ci #7

Closed damies13 closed 2 months ago

damies13 commented 3 months ago

Here's a minimal CI test build of the docker file. (Issue #2)

I needed to change the dockerfile to include the path to the requirements.txt file to get it to build so be aware of that before you merge this change

Feel free to rename the workflow file or it's name etc, I intended this to be a starting point for you to show you how to trigger GitHub's CI, from here you can tune it as you need.

It might be better to not use a requirements.txt file, but rather just put the pip command with the required packages directly in the docker file, then you only have the 1 file to manage, but I'll leave that decision to you

Dave.

Maresther-B commented 3 months ago

Here's a minimal CI test build of the docker file. (Issue #2)

I needed to change the dockerfile to include the path to the requirements.txt file to get it to build so be aware of that before you merge this change

Feel free to rename the workflow file or it's name etc, I intended this to be a starting point for you to show you how to trigger GitHub's CI, from here you can tune it as you need.

It might be better to not use a requirements.txt file, but rather just put the pip command with the required packages directly in the docker file, then you only have the 1 file to manage, but I'll leave that decision to you

Dave.

@KseniaYa can you take a look at this branche shared by Dave, when you'll start working on this issue please?

damies13 commented 3 months ago

FYI - Down the track if you want to run robot framework test cases replace these 2 lines:

      - name: Sleep for 30 seconds
        run: sleep 30s

with the call for robot framework (or any other) test cases

Maresther-B commented 3 months ago

I need to look at this PR I guess, cauz Ksenia is ill lately. So I need to look at this cauz for now I don't understand how "Action" works. I'll check this before the end of the week.

damies13 commented 3 months ago

It took me quite a while to figure out the actions the first time, basically it's a yaml file in a specific place that tells github to start a vm and run some commands in that vm whenever you check in some code.

I'll explain what I did line by line: This is just a name for the action

name: Check Docker Can Compose

This line tells github when to run the action (push means when you push changes to github from your local machine)

on: push

Jobs is the section for what to run

jobs:
  Check_Compose:

runs-on tells what type of vm (e.g. ubuntu-latest, windows-latest, macos-latest)

    runs-on: ubuntu-latest

The content of steps is basically like your docker file, it's what to run, but there are also some pre defined actions that people have created, like actions/checkout@v4 that checks out the current git branch onto the vm so all your files from your git repro are ready on the vm for you. the names of the steps are completely free text, you can call them what ever you like (hopefully something meaningful)

    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Check that the image builds and runs
        run: docker compose up -d
      - name: Sleep for 30 seconds
        run: sleep 30s
        shell: bash
      - name: Shut docker down
        run: docker compose down

The full documentation for github actions is here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

Yeah it's a bit hard to follow until you get used to it.

I hope Ksenia gets well quickly, being sick is no fun.

Maresther-B commented 3 months ago

It took me quite a while to figure out the actions the first time, basically it's a yaml file in a specific place that tells github to start a vm and run some commands in that vm whenever you check in some code.

I'll explain what I did line by line: This is just a name for the action

name: Check Docker Can Compose

This line tells github when to run the action (push means when you push changes to github from your local machine)

on: push

Jobs is the section for what to run

jobs:
  Check_Compose:

runs-on tells what type of vm (e.g. ubuntu-latest, windows-latest, macos-latest)

    runs-on: ubuntu-latest

The content of steps is basically like your docker file, it's what to run, but there are also some pre defined actions that people have created, like actions/checkout@v4 that checks out the current git branch onto the vm so all your files from your git repro are ready on the vm for you. the names of the steps are completely free text, you can call them what ever you like (hopefully something meaningful)

    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Check that the image builds and runs
        run: docker compose up -d
      - name: Sleep for 30 seconds
        run: sleep 30s
        shell: bash
      - name: Shut docker down
        run: docker compose down

The full documentation for github actions is here: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions

Yeah it's a bit hard to follow until you get used to it.

I hope Ksenia gets well quickly, being sick is no fun.

Thanks so much Dave, you gave me such big help here. I was trying to figure out how actions work on github and indeed it's not that intuitive.

damies13 commented 3 months ago

Thanks so much Dave, you gave me such big help here. I was trying to figure out how actions work on github and indeed it's not that intuitive.

Happy to help, just ping me if you have questions, I'll do my best to help,

The documentation follows the style you often see in software API's where it explains what each setting does, but there's no context and no coherent document that brings it all together to say you need these things to get started,

I find this style of documentation useful once you know a tool but a very high barrier to entry for beginners, and were all beginners at some point.