Skip to content

Commit

Permalink
remove conda channel setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmeaton committed Oct 2, 2020
1 parent ac9ad2a commit 16a4947
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ cd plague-phylogeography
conda install -c conda-forge mamba
mamba env create -f workflow/envs/default.yaml
conda activate default
conda config --add channels bioconda
conda config --add channels conda-forge
```

## Usage
Expand All @@ -74,7 +72,7 @@ snakemake \
--use-conda \
--conda-frontend mamba \
--profile profiles/gh-actions \
--report workflow/report/report.html \
--log_handler_script workflow/scripts/slack_log.py \
help
```

Expand Down
2 changes: 1 addition & 1 deletion profiles/graham/config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cores : "4"
default-resources: [cpus=1, mem_mb=2000, time_min=60]
resources: [cpus=4, mem_mb=8000, load=100]
resources: [cpus=4, mem_mb=4000, load=100]
Empty file modified workflow/scripts/slack_log.py
100644 → 100755
Empty file.
47 changes: 47 additions & 0 deletions workflow/scripts/slack_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os
from slack import WebClient
import platform # Get system name
from dotenv import load_dotenv # Reading env files
from datetime import datetime # Logging time

# import logging
# logging.basicConfig(level=logging.DEBUG)

# --------------------------------------------------------------------------#
# General Setup
# --------------------------------------------------------------------------#
load_dotenv()
token = os.getenv("SLACK_TOKEN")

if not token:
print(
"Please create an API token for your Slack App and",
"export SLACK_TOKEN='yourtoken' to a .env file.",
)
exit(-1)

client = WebClient(token=token)
node_name = platform.node()
now = datetime.now()
current_time = now.strftime("%H:%M")


if __name__ == "__main__":
client.chat_postMessage(
channel="snakemake",
blocks=[
{"type": "divider"},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":exclamation: *"
+ node_name
+ "* is testing slack integration at "
+ "*"
+ current_time
+ "*.",
},
},
],
)

0 comments on commit 16a4947

Please sign in to comment.