Skip to content

Instantly share code, notes, and snippets.

View MrCreosote's full-sized avatar

MrCreosote

  • Lawrence Berkeley National Laboratory
View GitHub Profile
@MrCreosote
MrCreosote / gist:a1fd88aaeb70fd0b6ea16ad18e89b91c
Created July 17, 2024 22:30
spark_yarn_client_mode_logs.txt
24/07/17 21:34:01 INFO SparkContext: Running Spark version 3.5.1
24/07/17 21:34:01 INFO SparkContext: OS info Linux, 4.15.0-213-generic, amd64
24/07/17 21:34:01 INFO SparkContext: Java version 17.0.11
24/07/17 21:34:01 INFO ResourceUtils: ==============================================================
24/07/17 21:34:01 INFO ResourceUtils: No custom resources configured for spark.driver.
24/07/17 21:34:01 INFO ResourceUtils: ==============================================================
24/07/17 21:34:01 INFO SparkContext: Submitted application: Spark Pi
24/07/17 21:34:01 INFO ResourceProfile: Default ResourceProfile created, executor resources: Map(cores -> name: cores, amount: 1, script: , vendor: , memory -> name: memory, amount: 1024, script: , vendor: , offHeap -> name: offHeap, amount: 0, script: , vendor: ), task resources: Map(cpus -> name: cpus, amount: 1.0)
24/07/17 21:34:01 INFO ResourceProfile: Limiting resource is cpus at 1 tasks per executor
24/07/17 21:34:01 INFO ResourceProfileManager: Added Res
24/07/17 21:30:49 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
24/07/17 21:30:49 INFO DefaultNoHARMFailoverProxyProvider: Connecting to ResourceManager at yarn-resourcemanager/172.26.0.3:8032
24/07/17 21:30:49 INFO Configuration: resource-types.xml not found
24/07/17 21:30:49 INFO ResourceUtils: Unable to find 'resource-types.xml'.
24/07/17 21:30:49 INFO Client: Verifying our application has not requested more than the maximum memory capability of the cluster (8192 MB per container)
24/07/17 21:30:49 INFO Client: Will allocate AM container, with 1408 MB memory including 384 MB overhead
24/07/17 21:30:49 INFO Client: Setting up container launch context for our AM
24/07/17 21:30:49 INFO Client: Setting up the launch environment for our AM container
24/07/17 21:30:49 INFO Client: Preparing resources for our AM container
24/07/17 21:30:49 WARN Client: Neither spark.yarn.jars nor spark.yarn.archive is set, falling back to uploading lib
@MrCreosote
MrCreosote / hacky_images_in_narratives.md
Last active February 12, 2024 19:19
Hackily add images to a Narrative and store said images in KBase
  • Note: this is not a reasonable general solution for images in narratives because:
    • Even if all the steps below were automated for the user, it suffers from the so called "copy of a copy" problem. Namely, if the narrative is copied by a different user and the user loses access to the source narrative, the narrative will no longer be able to access the report object embedded in the HtmlFileSetService URL.
    • The HTMLFileSetService dynamic url is hardcoded into the narrative markdown text and it's, well, dynamic. It can change at any time at which point the images will 404.

Procedure:

  • Add all your images to a zip file
  • Using your kbase token, upload the zip file to Shock
"""
Totally gross Q&D implementation of mapping microtrait traits to gene / hmm names.
"""
_RULE2_TRAIT = "./microtrait/data-raw/microtrait_rule2trait.txt"
_SUBSTRATE2_RULE = "./microtrait/data-raw/microtrait_substrate2rule.txt"
_RULE_UNWRAPPED = "./microtrait/data-raw/microtrait_ruleunwrapped.txt"
_OUT = "./traits2genes.tsv"
@MrCreosote
MrCreosote / copy_assemblies_to_env.py
Last active April 7, 2023 01:31
Copy assemblies from one KBase environment to another
import os
import random
import requests
import sys
import tempfile
import time
"""
Issues:
@MrCreosote
MrCreosote / stochastic_sortedness.py
Created June 22, 2022 22:33
Stochastic measure of the sortedness of a list
import random
def stochastic_sortedness(list_, num_samples):
''' Based on https://stackoverflow.com/a/16994740/643675 '''
if len(list_) < 2:
return 0
# a 2 item list works, but is a pretty dumb thing to pass to this function *shrug*
maxindex = len(list_) - 1
score = 0
import os
import sys
from pymongo.mongo_client import MongoClient
WS_MONGO_PWD = 'WS_MONGO_PWD'
MONGO_COL_WSOBJS = 'workspaceObjVersions'
def get_ws_obj_collection(argv):
import os
import sys
from pymongo.mongo_client import MongoClient
WS_MONGO_PWD = 'WS_MONGO_PWD'
MONGO_COL_WSOBJS = 'workspaceObjVersions'
def get_ws_obj_collection():
@MrCreosote
MrCreosote / gist:ffdd173574014196f8775abe7fa1ac46
Created February 11, 2017 01:44
EqualsVerifier missing instruction
import org.junit.Test;
import nl.jqno.equalsverifier.EqualsVerifier;
public class EqualsVerifierTesting {
private static class Foo {
private final String s;
@MrCreosote
MrCreosote / hideWS.py
Last active February 11, 2016 03:27
Hide public workspaces via the administration interface
'''
Makes the specified workspaces non-public.
Parameters:
wsclient - an initialized workspace client. The user logged into the client
must be a workspace administrator.
wslist - a list of workspace IDs and / or names.
'''