Skip to content

Instantly share code, notes, and snippets.

View mvidalgarcia's full-sized avatar
🐛
Feeding bugs

Marco Vidal García mvidalgarcia

🐛
Feeding bugs
View GitHub Profile
@mvidalgarcia
mvidalgarcia / delete_all_workflows.py
Last active February 4, 2022 15:17
Delete all your workflows in REANA cluster.
from reana_db.models import User, Workflow
from reana_db.database import Session
email = "[email protected]"
me = User.query.filter_by(email=email).one()
for wf in me.workflows:
for wr in wf.resources:
Session.delete(wr)
from kubernetes import client
from kubernetes import config as k8s_config
k8s_config.load_incluster_config()
api_configuration = client.Configuration()
api_configuration.verify_ssl = False
api_client = client.CoreV1Api()
api_client.list_node()
import time
import os
from getpass import getpass
from reana_client.api.client import (
create_workflow_from_json,
get_workflow_status,
ping,
start_workflow,
upload_to_server,
# $ git clone inveniosoftware/automation_tools
# $ cd automation_tools
# $ ipython
from automation_tools.repositories import GithubUtils
GITHUB_INVENIOSOFTWARE_URL = "https://github.com/inveniosoftware/"
GA_INVENIOSOFTWARE_BADGE_URL = GITHUB_INVENIOSOFTWARE_URL + "{}/workflows/CI/badge.svg"
inveniosoftware_repos = GithubUtils.list_organization_repositories('inveniosoftware')
payment_settings.set('currencies', payment_settings.get('currencies') + [{u'code': u'AUD', u'name': u'Australian Dollar'}])
db.session.commit()
from indico.core.db import db
from terminaltables import AsciiTable
db.session.execute('''
INSERT INTO events.requests (event_id, type, state, data, created_by_id, created_dt)
SELECT
rvl.linked_event_id,
'vc-assistance',
1,
json_build_object('comment', ''),
db.session.add(RoomAttribute(name="long-term", title="Long term", is_hidden=True))
ra = RoomAttribute.query.filter_by(name='long-term').one() # Burotel
for r in Room.query.order_by(Room.id.asc()).limit(100):
RoomAttributeAssociation(room=r, attribute=ra, value='true')
db.session.commit()