Building and Testing the SKAO Staging Service

Build the Service

  1. Create a tunnel (Minikube): If using Minikube, create a tunnel to expose the service:

    minikube service skao-staging-service --url
    
  2. Clone the repository:

    git clone https://github.com/MicheleDelliVeneri/skao-staging-service.git
    
  3. Build the Docker image:

    docker build -t skao-staging-service:latest .
    
  4. Modify the Helm Chart values: Adjust the values.yaml file to reflect your specific configuration requirements.

  5. Install the Helm Chart:

    helm install skao-staging-service ./charts/skao-staging-service \
        --set image.repository=skao-staging-service \
        --set image.tag=latest
    
  6. Access the frontend: Navigate to the service URL obtained via:

    minikube service skao-staging-service --url
    
  7. Explore Service docs:

    Navigate to minikube_url/docs to check the Docs Page, an interactive and auto-generated documentation interface provided by FastAPI, built using Swagger UI.

Testing the Service

  1. Set up local directories:
    Create two directories on your host machine:
    • One for simulating the local storage.

    • Another for simulating the target user area.

  2. Configure Helm values:
    Update the values.yaml file:
    • Set storage.source.local.hostPath to the local storage directory.

    • Set userArea.source.local.hostPath to the target user area directory.

  3. Create a file:

    Use the File Creation Tool in the frontend to create a test file.

  4. Stage the file:

    Use your preferred staging method to move the created file. This operation can be perfomed through the GUI or by sumbimitting a staging request through the FastAPI docs As an example:

    {
      "data": {
        "local_path_on_storage": "/mnt/storage_a/File1.txt",
        "relative_path": "File1Copy.txt"
      }
    }
    
  5. Check the file copy

    kubectl get pods
    kubectl exec -it skao-staging-service-pod -- ls -la /mnt/storage_b/user_areas/File1Copy.txt